<body>
<div id="header">
<div id="header_center">
<div class="logo"></div>
</div>
I want to use the following CSS:
#header#header_center.logo {
float:left;
background-image: url(images/logo.png);
background-repeat: no-repeat;
width: 297px;
height: 85px;
}
… but it’s not working. If I just use ‘.logo’ then it works. Why I can not use ‘#header#header_center.logo’?
The CSS you’ve posted will select an element that looks like this:
What you need to do is add spaces between your selectors so it will instead select nested elements.