There are three different ways you can include CSS on your website.
- Link to a .CSS file
- Write the CSS between the head elements of your web page
- Mix the CSS with the HTML by using the style attribute of the HTML tags
1 – Link to a .CSS file
<head> <link rel="stylesheet" type="text/css" href="cssFileName.css" /> </head>
2 – Write the CSS between the head elements of your web page
<head> <style type="text/css"> body {background-color: blue} h1 {color:white; font-size:12pt} p {margin-left: 10px} </style> </head>
3 – Mix the CSS with the HTML by using the style attribute of the HTML tags
<p style="margin-left: 10px"> This paragraph will have a 10 pixel margin on the left! </p>
Don’t trust your browser!
Always test your CSS changes in multiple browsers – it won’t always behave as you expect! I get the best results and suffer from the least frustration when when I get the CSS working in Firefox first, then test to see if it works in Internet Exlporer.
BEWARE – If you get your CSS to work with Internet Explorer first, it rarely works the same way in Firefox upon testing!