开发者

Declaring same css for more than one id?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜