|
Ok, so we've reached the point where we want to actually create a style sheet. There are two ways to implement a style sheet,
external and internal. Lets look at the External Style Sheet first.
External Style Sheets are a probably the most commonly used way of implementing CSS because with one file you can make changes
across hundreds or thousands of pages on a website.
In order for each page to be updated the pages must link to the CSS file. This is done by using the
<link> tag. which goes inside the head section of the HTML document.
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
|
The stylesheet in this case is called "style.css" and the browser has been told because of the link tag
to read the style definitions from the file "style.css".
The external style sheet can be created with any text editor and remember when you save the file it must be
saved with a .css file extension.
Our basic style sheet would look something like this;
body {
background-color: #F0F0F0
}
h1, h2, h3, h4, h5 {
font: 100% verdana, serif
}
p.green {
font-family: verdana;
color: green;
text-align: center
}
|
The Internal Style Sheet would be used when you want to have one page or document on your website have a distinctive style.
The internal style is defined in the <head> section by using the <style> tag.
|
<HEAD>
<STYLE TYPE="text/css">
<!--
body {
background-color: #F0F0F0
}
h1, h2, h3, h4, h5 {
font: 100% verdana, serif
}
p.green {
font-family: verdana;
color: green;
text-align: center
}
-->
</STYLE>
</HEAD>
|
|