HTML Code Tutorial

Linked Style Sheets

Linked style sheets are placed in a separate text file and saved in the root directory. The file is saved with a css extension. The link to the file is placed in the head section of each document.

Linked style sheets contribute to the creation of consistency throughout your web pages.

Code in Head Section:
<head>
<link rel="stylesheet" href="mystyle.css" type="text/css">
</head>

Example of lines in mystyle.css text file:
body {text-align :center}
p {font-family: Arial, sans-serif ;font-size : 10pt ; text-indent : 1em}
h1 {font-family: Arial Black, serif ;font-size : 16pt;text-align :center }
h2 {font-family: Arial Black, serif ;font-size : 14pt ;text-align :center}
.bold{ font-weight : bold}
.red{ font-weight : bold; color : red}
#toc a{ font-family: Arial;font-style : normal ;font-size : 8pt; font-weight :bold;text-decoration : none}

As you can see from the examples above even your class and ID specifications can be included in your linked style sheet.



Take a Quiz on the information you just read.