48
230
INTRODUCING CSS
CSS allows you to create rules that control the
way that each individual box (and the contents
of that box) is presented.
In this example, block level
elements are shown with red
borders, and inline elements
have green borders.
The
<body>
element creates the
first box, then the
<h1>
,
<h2>
,
<p>
,
<i>
, and
<a>
elements each
create their own boxes within it.
Using CSS, you could add a
border around any of the boxes,
specify its width and height, or
add a background color. You
could also control text inside
a box — for example, its color,
size, and the typeface used.
Width and height
Borders (color, width, and style)
Background color and images
Position in the browser window.
Typeface
Size
Color
Italics, bold, uppercase,
lowercase, small-caps
There are also specific ways
in which you can style certain
elements such as lists, tables,
and forms.
exaMpLe StyLeS
BoxeS
text
SpecIfIc