Dynamic HTML: The Definitive Reference, 2rd Ed.Dynamic HTML: The Definitive ReferenceSearch this book

3.4. The CSS Platform

The type attribute of the <style> tag is where you specify the language and syntax you'll be using for your style sheets. This value is in the form of a content-type declaration, and the CSS specification declares text/css as its preferred content type. By convention, today's browsers treat text/css as the default type, but the <style> tag's type attribute is required in the HTML 4 recommendation. Therefore, always specify the type attribute for all <style> tags. A style element that relies on the CSS syntax should look like the following:

<style type="text/css">
...
</style>

For trivia buffs, Navigator 4 (only) featured a short-lived alternative syntax that followed the JavaScript object reference format. This alternate type, text/javascript, provided JavaScript equivalents for most of the style attributes and structures provided by the text/css syntax.



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.