13.02.2013 Views

WEB STANDARDS CREATIVITY

WEB STANDARDS CREATIVITY

WEB STANDARDS CREATIVITY

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

66<br />

What’s the benefit to this approach, you may ask? By relying<br />

on this class-driven toggle, the rest of our markup<br />

can be reused for both layout scenarios: simply by changing<br />

ad-column-180 to ad-column-300 in our template’s<br />

body, we can instantly restyle the display of our markup.<br />

Figures 3-13 and 3-14 show this in action on two different<br />

Figure 3-13. Our finished article template, with ad-column-180 in the body element’s class attribute.<br />

live, production-ready article templates—and the only<br />

thing that’s changed between the two are a few characters<br />

in the body element’s class attribute. The rest of the<br />

markup on these two pages is identical. I don’t know<br />

about you, but I tend to get geekily excited about stuff<br />

like this.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!