by Vivienne Trulock
Choose Method: Show Dreamweaver Instructions | Show Code
There are several different flavours of style sheets. The simplest type of style is to modify an existing HTML tag. Using the template that you worked on in the template page and these images, we will make a replica of this page. Save the images into your images folder before beginning.
First you need to have some paragraph text inside your HTML file - i.e. text which is surrounded by <p> and </p> tags - because it is the 'p' which tells the CSS styles to affect how the paragraph text is displayed.
To create paragraph text in Dreamweaver, type in some text, highlight it and in the 'Format' drop down menu in the properties window select 'Paragraph'.
Simply insert some text into the <body> of the HTML document and wrap in <P> and </p> tags.
<body>
<p>I’m tired of appliances breaking in my house; <br />
the shower, the dryer, the car, the hoover, the curtain rail and the mouse.</p>
</body>




The CSS1 paragraph style should look like this:
The CSS2 paragraph style should look like this. You can see how 4 lines of CSS1 code have been condensed into 2 lines of CSS2 code. The 80% and 150% refers to the font-size and line-height of the CSS1 code shown above.
Many web designers choose to define default font and background colour settings for the page. As the styles sheets are 'cascading', styles defined for the <BODY> tag are inherited by the elements inside the body. So, defining the font to be Verdana in the body style, also sets paragraph text, header text and list text to be Verdana, by default. However, be careful when sizing fonts with % because they accumulate... try the code below in addition to the paragraph font above.


The CSS1 code for the body style looks like this:
The CSS2 code for the body style looks like this. Notice that the margin specification takes up one line, rather than 4.
If you now check your page, you should see that your paragraph text is even smaller than before. This is because it is now 80% of 80%, or 64%. Removing the 80% from the paragraph style will return it to normal size, because it will inherit the body 80% size only.
All tags are defined in the same way. If using Dreamweaver if is worthwhile spending some time selecting the different options in the CSS window and studying the results.
If using HTML & CSS code, it might be useful to read through the CSS and HTML specifications published by the W3C.