I have the following code (generated by Drupal; I have no control over it.)
<div class="spacer">
<div class="region region-home-ad-banner">
<div id="block-views-banner-ad-block-block" class="block block-views contextual-links-region">
<div class="contextual-links-wrapper">
<ul class="contextual-links">
<li class="views-ui-edit first">
<a href="/banner_ad_block/edit/block?destination=node">Edit view</a>
</li>
<li class="block-configure last">
<a href="/banner_ad_block-block/configure?destination=node">Configure block</a>
</li>
</ul>
</div> <!-- end contextual-links-wrapper -->
<div class="content">
<div class="view view-banner-ad-block view-id-banner_ad_block view-display-id-block view-dom-id-542147d83a500d1c31244e2e2a583562">
<div class="view-content">
<div class="views-row views-row-1 views-row-odd views-row-first views-row-last">
<div class="views-field views-field-field-ad-image">
<div class="field-content">
<a href="http://www.externallink.com" target="_blank">
<img src="expo-home-page-banner.jpg" width="912" height="100" alt="" />
</a>
</div>
</div>
</div>
</div>
</div>
</div> <!-- end content -->
</div> <!-- end block-views-banner-ad-block-block -->
</div> <!-- end region-home-ad-banner -->
</div> <!-- end spacer -->
I have this css that works:
.spacer img{
background: #ffffff;
border:5px;
margin-left: 0px;
padding-top: 30px;
padding-bottom: 20px;
}
I need to apply a background style to the div with the class “region-home-ad-banner”, so I tried this:
.spacer>div.region-home-ad-banner {
background: #ffffff;
}
According to Firebug, that selector isn’t being applied at all. It’s not being overwritten by something with higher priority, it just isn’t happening at all.
Why would .spacer img find what it needs to, even though the img tag is buried in multiple levels, but .spacer>div.region-home-ad-banner isn’t finding the div that’s the immediate child of .spacer?
EDITED TO ADD SCREENSHOT

This can be due to several reasons:
Caching:
Open the CSS tab in firebug, choose the CSS file, and make sure that rule is available in your CSS.
In that case, clear your cache (sometimes CTRL + F5 are not enough) and retry.
Typo:
Make sure you don’t have any typo errors, open the console in firebug and check for warnings. Or open the
Error Consolein Firefox. (Tools–> Web Developer –> Error Console)It can be a typo from a previous rule, for example, forgetting to put a closing curly bracket (
}) will break your following rules.