13.07.2015 Views

Beginning CSS: Cascading Style Sheets for Web Design, 2nd ...

Beginning CSS: Cascading Style Sheets for Web Design, 2nd ...

Beginning CSS: Cascading Style Sheets for Web Design, 2nd ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Part II: PropertiesIn Firefox and other Gecko-based browsers, you must add the -moz- prefix. So it would be-moz-box-sizing instead of box-sizing. -moz-box-sizing also supports one additionalkeyword, padding-box.The declaration box-sizing: border-box; is provided <strong>for</strong> Safari and Opera, and the declaration-moz-box-sizing: border-box; is provided <strong>for</strong> all Gecko-based browsers, Firefox, Netscape, MozillaSeaMonkey, and so on; thus those browsers use Microsoft’s box model instead of the standard W3Cbox model.Conditional CommentsThe other method that you can use is to alter output <strong>for</strong> IE instead of altering <strong>for</strong> other browsers, byusing conditional comments to specifically target IE, which is the method that I personally prefer. Bytargeting the quirk in IE specifically, you can use the standard W3C box model, and not use a propertythat may or may not be implemented in other lesser-known third party browsers. Conditional commentsare a Microsoft-proprietary HTML feature, and they allow you to target various or specific versions ofInternet Explorer. Conditional comments were introduced in IE 5.0; Figure 7-38 is an example of conditionalcomments in action.The markup in Figure 7-38a results in the output that you see in Figure 7-38b.Figure 7-38a258

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

Saved successfully!

Ooh no, something went wrong!