HTML and CSS Reference
In-Depth Information
To Create an External Style Sheet
Table 4-8 shows the style statements for an external style sheet for the Oceanside Hotel and Sports Club Web site.
To create an external style sheet, you will open a new text file and enter the CSS code for the style statements that define the
Web page style. After coding the style statements, you will save the file with the file extension .css to identify it as a CSS file.
Table 4-8 Code for an External Style Sheet
Line
CSS Properties and Values
body
{font-family: Centaur, “Century Gothic”, Arial;
1
font-size: 14 pt;}
2
3
4
p
{margin-left: 10pt;
margin-right: 10pt;}
5
6
7
a
{text-decoration: none;
color: black;}
8
9
10
img
{border-color: transparent;}
11
12
table {width: 65%;
margin-left: auto;
13
margin-right: auto;
14
border-color: #545859;
15
border-style: ridge;
16
border-width: 10px;}
17
18
19
.menu {text-align: center;
width: 60%;}
20
21
22
.menuicon {width: 23%;}
23
24
.menupipe {width: 1%;}
25
26
th
{color: white;
background-color: #757775;}
27
28
29
tr.stripe {background-color: #d8d8ce;}
30
td.bolder {font-weight: bold;}
31
32
33
caption
{caption-side: bottom;
font-style: italic;}
34
The following steps illustrate how to create, save, and validate an external style sheet. You must use a different
w3.org validation service to validate a .css file. You will use jigsaw.w3.org/css-validator/#validate_by_upload for the
.css file type. The validation result page looks very similar to the ones you saw in the HTML validation process.
Search WWH ::




Custom Search