<style> and </style>

PURPOSE: To define a inline Cascading Style Sheet. It goes in between the "head" tags

Below is a basic html document. The referenced html tag is in RED. All tags must have a start and a end tag. Most end tags have a / before the tags name, however there are a few that are done differently. The tags that end differently will be noted and highlighted. The order of the start and end tags is also very important to proper display of your page in a web browser.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title> The Page Title Goes Here </title>
<style type="text/css">
.c {text-align:center;}
.r {color:red; font-weight:bold;}
hr {color:blue;}
h2 {text-decoration:underline;}
h4 {color:red; font-weight:bold;text-align:center;}
h3 {text-align:justify;}
p {font-size:medium;}
</style>
</head>
<body>
<p class="r">
This paragraph will be a medium font and red bold text.
</p>
<h2>
This heading will be underlined.
</h2>
</body>
</html>


All styles are enclosed in "{}" curly braces. Here is what the above style command means:

Any name with a "." in front of it will be defined as a class item. Like so, since .c is defined as centered text the tag p class="c" would center that paragraph only.

Any tags defined would cause each tag of that type to be the same. Like so, h4 is defined as being red, bold font, and aligned center so all h4 tags will be red, bold, and aligned center.


© Copyright 2001,2002 Southern Twilight    All rights reserved.

Back To HTML Examples