This style is related to one or more HTML pages. These styles are specified in a separate file (.css) and to be attached to HTML pages using LINK element.
Pros:
Cons:
Example (code portion from .css file):
body {
width:800px;
border:dotted;
}
CSS file (corestyles.css) contents.
body {
width:800px;
border:dotted;
}
h1{
text-align:center;
}
h2{
background-color:green;
color:white;
}
p{
font-family:arial;
}
CSS external style example.
<!DOCTYPE html />
<html>
<head>
<link rel="stylesheet" href="corestyles.css"/>
<title> CSS External Style </title>
</head>
<body>
<h1>CSS Styles</h1>
<h2> Different ways to apply CSS styles</h2>
<p> a) Inline style </p>
<p> b) Internal style sheet</p>
<p> c) External style sheet </p>
</body>
</html>
Result:
In the above example,