There are three types of style sheets
These styles are written inside of the tag itself. For example:
<p style="background-color: #dddddd; border:thin dotted #AAAAAA">
This is a local style</p>
Results in:
This is a local style
Any tag can be modified with a local style
These styles are specified in the head of the HTML document. To get the same results as above, we could write the following
<head>
<title>Internal Styles</title>
<style>
.special {
background-color: #DDDDDD;
border:thin dotted #AAAAAA;
}
</style>
</head>
<body>
<p class="special">This is an internal style</p>
</body>
Once you've caught onto the idea of internal style sheets, external style sheets are very close to the same.
.special {
background-color: #DDDDDD;
border:thin dotted #AAAAAA;
}
<link rel="stylesheet" href="mystyle.css" type="text/css" />
| Topic | w3schools Link | Brief Description |
|---|---|---|
| Text | http://www.w3schools.com/css/css_text.asp | color, alignment, decoration (ie. underlining or strikethrough), and indentation |
| Fonts | http://www.w3schools.com/css/css_font.asp | font-family, style (like italics), and size |
| Border | http://www.w3schools.com/css/css_border.asp | style (ie. dotted or dashed), width, and color |
| Align | http://www.w3schools.com/css/css_align.asp | centering and left/right aligning block elements |