开发者

How to format a class class inside an id?

I have the following HTML:

<div id="foo开发者_运维百科ter">
  <div class="wrapper clear">
    <!-- stuff -->
  </div>
<div>

What do I put in the css file to format the div that has a class of wrapper and clear, but only when within the footer?

This is for use with wordpress.com, so I can't alter the HTML.


Use this selector:

#footer .wrapper.clear

Note that IE6 doesn't handle multiple class selectors correctly, it treats the above as this (see here for a comparison):

#footer .clear

But in most cases this should not matter.


I think what you are looking for is this:

#footer div[class="wrapper clear"] { /* your awesome CSS code */}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜