Help me, please, to understand, what does the first line mean in CSS-Code:
#cont开发者_高级运维ent-right h1 {
font-size: 100%;
.....
c...
}
That's ID, right? Why is h1 after #ID, shouldn't it be like h1#ID?
This is a descendant selector.
It selects all h1
s inside of #content
#content-right h1
means a H1 element inside an element with id "content-right".
h1#content-right
means a H1 element with the id "content-right".
basically it says all the h1
inside of a container with the id content-right
have font-size 100% and whatever else is in there.
above css works on h1 inside div which have id=content-right
<h1>outside div</h1>
<div id ="content-right">
<h1>Inside div</h1>
</div>
精彩评论