CSS选择器

http://www.runoob.com/cssref/css-selectors.html

1.* 选择所有元素

2.div>p

3.div+p

css----

div>p
{
background-color:yellow;
}

div+p
{
background-color:yellow;
}

body----

<h1>Welcome to My Homepage</h1>
<div>
<h2>My name is Donald</h2>
<p>I live in Duckburg.</p>
</div>

<div>
<span><p>I will not be styled.</p></span>
</div>

<p>My best friend is Mickey.</p>

posted @ 2019-03-18 12:47  红藕  阅读(109)  评论(0编辑  收藏  举报