Method B: A Class Act?

 < Day Day Up > 



Method B: A Class Act?

 <div >   <p>Misquotations are the only quotations that are never misquoted.</p>   <p>&#8212; Hesketh Pearson </p> </div> 

Because of the that is added to the <div> tag that surrounds the quotation, we could style it uniquely with CSS, after the fact. But it seems a bit unnecessary to create this extra class when there's a perfectly good HTML tag that exists for this purpose. And we'll reveal that perfectly good HTML tag in just a minute.

Once we start using a <div> with a class attached, we're also locked into coding all quotations throughout an entire site this way if we'd like the style to be consistent. We must also remember this particular syntax for marking up quotations in the future. This is especially a bummer if we're dealing with a large site with multiple <div> and class combinations for various structural elements throughout the page. It can easily start to get messy, and you'd need a roadmap to keep track of all the custom class names you've created.

There is also the issue of viewing a quotation marked up this way without CSS, whether it be unavailable or unsupported. Since the <div> is just a generic container, there is no default styling applied to content placed within them. This is important for people using old browser versions, text browsers, or screen readers. Take a look at the quotation sans CSS, and it would appear just like everything else on the page.



 < Day Day Up > 



Web Standards Solutions. The Markup and Style Handbook
Web Standards Solutions: The Markup and Style Handbook (Pioneering Series)
ISBN: 1590593812
EAN: 2147483647
Year: 2003
Pages: 119
Authors: Dan Cederholm

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net