开发者

How to format a class class inside an id?

开发者 https://www.devze.com 2023-02-09 23:33 出处:网络
I have the following HTML: <div id=\"foo开发者_运维百科ter\"> <div class=\"wrapper clear\">

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

精彩评论

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