开发者

What does this ID in CSS-Code?

开发者 https://www.devze.com 2023-03-03 17:54 出处:网络
Help me, please, to understand, what does the first line mean in CSS-Code: #cont开发者_高级运维ent-right h1 {

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 h1s 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>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号