External Stylesheet
External Stylesheet
(in some_file.css)
h1{
color:white;
}
img{
float:right;
}
Link in .html file, in <head>
<link rel="stylesheet" type="text/css" href="some_file.css" />
Internal Stylesheet(in the head)
<head>
<title> Test Page </title>
<style type="text/css">
h1{
color:white;
}
img{
float:right;
}
</style>
</head>
If you want to effect more than one page, you will need an external stylesheet. An external stylesheet is stored in an external file with the extension of ".css". It is included in a webpage by using a <link /> element, referring to the stylesheet file with the href attribute. You will generally store the external stylesheet in the same directory as your files. See Parts of a CSS Rule for how to construct a rule.
- NO XHTML tags go in the external stylesheet (use CSS comments as well)
- Best for when you need to effect multiple pages with the same styles
- Make sure filenames and extensions match in both the <link> and the .css file.
Back to Knowledge Dump