If you want to set up a stylesheet to affect one Web page, you can do that with a stylesheet in the head of your document. For this you use the <style></style> tag in the <head> of your Web document.
Rules for Style Sheets
- Style tags should be held in the <head>
While you can include style tags elsewhere in a document, browsers might not suport this.
- All style information should be stored within the <style> and </style> tags.
This is how the browsers know that the information is for styles.
- Always include a type attribute in your style tag.
This attribute indicates what types of style rules you will be using. The most common type of style rule is CSS, but there are other types (XSL, JSS, and others).
Tips for Working with Style Sheets
Here are some tips for working with these stylesheets:
- Start them out right
Use attributes of the <style> tag to define what the browser should expect
<style type="text/css">
- Use comments
Comment tags insure that older browsers don't display your stylesheets.
<style type="text/css">
<!--
style properties
-->
</style>
- think about your styles
In many cases, you don't need to set a lot of different styles, just simple ones that cover how your text and other elements should be displayed on your page. If you don't plan to have any red, blinking, 36 point headlines on your page, then defining a style for that is a waste of bandwidth.
Sample <head>
<head>
<title>sample head of an HTML document</title>
<style type="text/css">
<!--
body {
font-family : arial;
font-size : 12pt;
}
-->
</style>
</head>
Next Page: External Style Sheets > 1, 2, 3, 4

