HTML and CSS Reference
In-Depth Information
A CSS rule is made up of a selector and a semicolon-separated list of
declarations inside brackets. Each declaration has a property and a
value separated by a colon. If an element in an associated HTML docu-
ment matches a selector in the style sheet, then the declarations will be
applied to that element.
To help you get the idea, here's a full example page with a style sheet.
The style sheet is in the head section of the document in a <style> ele-
ment. There are three rules in the style sheet: a rule for the <body> ele-
ment, a rule for the <p> element, and a rule for the <em> element:
<!DOCTYPE html>
<html>
<head>
<title>Simple CSS Example</title>
<style>
body {
font-family: "Komika
Hand";
font-size: 250%;
}
p {
color: blue;
font-size: 1.4em;
}
em {
color: teal;
}
</style>
</head>
<body>
<p>A paragraph
<em>with emphasis</em>
</p>
</body>
</html>
 
Search WWH ::




Custom Search