Web Design |
topic title |
||||
main menushelp pagesprinter-friendly/text-only version your accountUse your ACOM account to access the discussion boards, submit course work and check marks and feedback Essential related topicsRelated topics |
The <STYLE> tag
If you want the style definitions you are creating to apply throughout one particular HTML file, you can place these definitions in the <HEAD> of that document, between <STYLE> and </STYLE> tags. To prevent older browsers from trying to interpret the contents of a style declaration, you should enclose the definitions between HTML comments which, in case you'd forgotten, start with an angle bracket, an exclamation mark and two hyphens, and end with two hyphens and a closing angle bracket. In this way you can hide anything that may cause problems for an older browser whilst leaving the code visible to newer browsers. So any style definition you include in a page should be bracketed as follows:
<STYLE type="text/css"> <!--
style definitions go here
--> </STYLE>
This will make your page more 'backwards compatible' that is, older web browsers will not try to display any information bracketed between the <STYLE> tags. The type attribute is compulsory and at the present time you might as well consider "text/css" as the only possible value; the attribute is there as a kind of placeholder for future developments in style technology, but this is beyond the scope of this site. For exactly what goes inbetween the <STYLE> tags, see the page on tag definitions. This is a relatively uncommon way of arranging things, however: simply because external style sheets are more powerful. Do remember, though, that style definitions in document headers override external style sheets. If you want, on a single page, to supersede a "universal" style defined in an external sheet, this is a convenient way to do it.
|
Material on this site is © Drew Whitworth, 2005 Permission will usually be given to reproduce material from this site for non-commercial purposes, if credit is given. For enquiries, e-mail Drew at andrew [dot] whitworth [at] manchester [dot] ac [dot] uk.