开发者

Declaring same css for more than one id?

开发者 https://www.devze.com 2023-02-21 21:02 出处:网络
How do I do it. #foo, #ball, #tre开发者_Python百科e h1 {color: #892828;} Does not seem to work?if you want to style all H1 under those Ids, you have to repeat H1 for every one as they don\'t share

How do I do it.

#foo, #ball, #tre开发者_Python百科e h1 {color: #892828;}

Does not seem to work?


if you want to style all H1 under those Ids, you have to repeat H1 for every one as they don't share anything:

#foo h1, #ball h1, #tree h1 {color: #892828;}

what you wrote is equivalent to:

#foo {color: #892828;}
#ball {color: #892828;}
#tree h1 {color: #892828;}


You could also assign the same class to each of those h1s and style using that class.

0

精彩评论

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