|
|
XHTML/CSS |
| After the incompatibilities that arose from web design using HTML 4 spec, the W3C decided to scrap formatting and return HTML to its roots as a *structural* markup language. CSS is the separation of formatting from content. XHTML 1.x is the conformation of HTML to well-formed XML while remaining backwards compatible; XHTML 2 will not be backwards compatible and in all likelihood will require a different MIME-type to prevent legacy browsers from requesting/parsing it. For example, XHTML 2 will make more attributes global; individual list items could have their own HREF attribute rather than having to wrap A tags. When XHTML 2 becomes a viable spec is anyone's guess.
We prefer to link to stylesheets using @import because Netscape 4 doesn't understand it and therefore won't apply its half-assed implementation to it. This doesn't prevent NN4 from recognizing inline styles, though. A chief caveat in working with CSS is the flawed support found in IE 6. Some view hacks as the solution (a la the days of JavaScript) whereas others prefer to define their selectors so explicitly as to make misinterpretation impossible. For example, whereas most browsers recognize body {margin:0} as equivalent to the margin attribute of the body tag, Opera does not and prefers {padding:0} for this effect. Declaring body {margin:0; padding:0;} resolves this problem for all browsers. More important is the extent to which IE 6 does not support CSS 2 spec, which is why some of the cleverer dynamic menu layouts (which would end DHTML as we know it) are not as popular. It is hoped that Microsoft will bend to supporting CSS 2 fully, but until there's an IE 7 we won't know. What we do know is that modern browsers respect DTDs and base their conformance on those declarations. People who edit valid XHTML files and insert HTML 3/4 spec code (ALL CAPS, unclosed tags, etc.) may be in for a surprise when the code hits the browser.
CSS is a balancing act of establishing display rules for tags, spans and/or blocks. Mercifully there are plenty of online resources for the beginner which demonstrate the concepts and slowly guide you into the pitfalls. http://www.alistapart.com is one of the best academic sources on where CSS is going and what it can do, as well as tutorials. | |
| [Append to This Answer] |
| Previous: |
|
| Next: |
|
| ||||||||