This page looks plain and unstyled because you're using a non-standard compliant browser. To see it in its best form, please upgrade to a browser that supports web standard_personals. It's free and painless.

Build A Website Blog

Using Style Sheets

Dave | 31 December, 2004 11:22

Following on from my post the other day, here's how to use a style sheet
to control the background and font color on your web pages:

<style type="text/css">
body{
color:#000000;
font:14px Arial, Helvetia, sans-serif;
background-color: #FFFFFF;
}
</style>

the above example sets the default background color to white (#ffffff)
the default text color to black (#000000) and well as the default font size and type for your text.

Just add the above code between the html <head> and </head> tags.

Look out for more examples on how to use style sheets to control the look and feel of your web pages.


Comments for post

Comment Icon Style Sheets

Dave | 31/12/2004, 15:42

Thanks for your comments Joe.

You can embed the style commands into your pages or include them in a separate file.

The advantage of using a file is when you make a change it's reflected across your site instantly. For the benefit of those that don't know how to do this add the following code to your page:

<link rel="stylesheet" href="style.css" type="text/css">

between the <head> and </head> tags

Then save your style commands in a file, in the above example the file would be called style.css and would have been uploaded to the same folders as your webpages.

Comment Icon

Joe | 31/12/2004, 15:29

Dave - that's great! I always thought you had to have a stylesheet as an external file. I learn something every day from you!

 
Build A Website | Javascript | HTML Help | Persuasive Copywriting | HTML Form | Simple eMail Form | Build A Website Map