HTML5 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 {
max-width: 1200px;
margin: 0 auto;
font-family: Arial, sans-serif ;
font-size : 18px ;
color: #000000
}


p {
text-indent : 16px;
text-align: left}


h1 {
font-size : 22px;
text-align :center
}


strong{
font-weight : 700;
color: #876541
}


p.red{ font-weight : 600;
color : #ff0000
}


#reddiv {
width: 100%;
background: #ff3300
}

See also: Class Attribute