CSS introduction
Cascading Style Sheets should allow you set margins, and specify font sizes in points, font attributes (italics, underline, etc), page margins, positioning, visibility, etc. You can also change link colours.
Standards for, and implementations of, Cascading Style Sheets (CSS) are still very patchy, however. The CSS1 standard has been adopted; CSS2 (an "official" W3C recommendation) is in draft. A standard for Cascading Style Sheets - Positioning (CSS-P) is also in draft, aimed at describing properties for the locations of objects in HTML pages. If you are going to use CSS, you need to try out your pages in all the browsers that your users are likely to use. Browsers that do not support CSS should still display your content (i.e. style sheets are downward compatible).
Styles can be used to control page layout (margins, padding), fonts (size and style - plain, italic or bold) and other text properties such as upper/lower case, colour, indent, alignment. They can be applied to individual HTML elements, a block of a page, or a class of elements having the same CLASS or ID name.
If you want your pages to look good in older browsers, design your pages in one of them, then add your CSS styles. Then when the older browsers ignore the CSS, the pages will still look OK.
Netscape 3.x does not support style sheets, and MSIE 3.x is very poor. Netscape 4.x is better, and MSIE 4.x/5.x is better still but there is still a long way to go. Any two browsers supporting an element may handle it differently. It is therefore best to try out your pages in as many browsers as necessary.
DHTML depends on stylesheets, and stylesheets depend on HTML.
Ways of applying styles
There is not a great deal of point adding style information inline, as this does not separate the style from the structure, but you can do it. This is called inline style. It is done on-the-fly. You either apply the style to an existing tag, or to a SPAN tag enclosing the text to which you want to apply the style. (Note that SPAN is different to DIV. DIV is used to demarcate the presence of any kind of new object on a page and implies a line break, whereas SPAN does not affect the flow of the page.)
To standardise the look of some of your pages, place a style block at the top of each page. Here, the STYLE tag must be contained in the HEAD of the document.
To standardise a whole site, link to an external style sheet. That way, you can change the appearance of the whole site just by amending one file. It does slow down the site a little though, as the link needs to be opened for each page. This way, you can link the same content pages to different style sheets to provide different versions for your site, including a printable version. You insert a LINK tag in the HEAD of your document.
If you use 2 or more of the above methods in a file, and there are two style rules for the same HTML element(s) in a document, then the rule nearest to the affected element takes precedence. This is called 'cascading', hence cascading style sheets. If you want to override the rules of priority and inheritance, just add ! important to the end of the style, for example:
h3 {color: red ! important; }
Embedding your stylesheet
To prevent older browsers from displaying your style sheet data on screen, use <style type="text/css">, plus comment tags surrounding your code. For example
<style type="text/css">
<!--
h1 { font-family:Ariel; font-style:normal; color:red }
blockquote { font-family:Times; font-style:bold; color:blue; word-spacing:-0.2em }
-->
</style>
