Posts Tagged ‘descendant selectors’

Flexible CSS – Combining Classes vs Descendant Selectors
December 31st, 2009 by moonpixel

Separating semantic and presentational code is a great idea, however sometimes it’s worth not going 100% by the book.
For content like text and images I am finding, that a bit more HTML (XHTML) markup can save lots of time in the long run.

XHTML which is short and sweet:

<div id="main-content">
<h1>Header <span>(some additional words)</span></h1> 
<p>Some text...</p>
<img src="..." />
<p>Some more text...</p>
</div>
  • Search Moonpixel

  • Blog Categories

  • Ads
    LoungePad
  • AdSense
  • Chitika
  • Subscribe for Updates

  • Moonpixel on Facebook

  • @moonpixel on Twitter