Call (877) SITE-OPT (748-3678)

Code: Use Descendant Selectors

From Chapter 7: CSS Optimization

Here is a minimalist example of a descendant selector:

<style type="text/css"><!--
    div.warning p{color:red;} /* descendant selector */
--></style></head><body>

<div class="warning">
    <p>Warning! Meltdown is imminent.</p>
</div>

The descendant selector in the preceding code (div.warning p) targets the paragraph element that is contained within the <div> element.

Copyright © 2002-2017 Website Optimization, LLC. All Rights Reserved - Free website speed test - Privacy Policy
Last modified: February 19, 2009.

Follow us on: Twitter, Google+, Facebook, Linked In