HTML and CSS Reference
In-Depth Information
Table 6.1
CSS properties used with formatting and page layout
Property
Description
Commonly Used Values
background-color
Background color on an element
Any valid color
background-image
Background image on an element
url(imagename.gif)
or
url(imagename.jpg)
background-position
Position of the background image
Two percentage values or numeric pixel val-
ues. The first value configures the horizontal
position and the second configures the vertical
position starting from the upper-left corner of
the container's box. Text values can also be
used:
left
,
top
,
center
,
bottom
,
right
.
Controls how the background
image will repeat
Text values
repeat
(default),
repeat-y
(vertical repeat),
repeat-x
(horizontal
repeat),
no-repeat
(no repeat)
background-repeat
Shorthand notation to configure
the
border-width
,
border-
style
, and
border-color
of
an element
The values for
border-width
,
border-
style
, and
border-color
separated by
spaces. For example:
border:1px solid
#000000;
border
Color of the border around an
element
Any valid color
border-color
Type of border around an element
Text values
double
,
groove
,
inset
,
none
(the default),
outset
,
ridge
,
solid
,
dashed
,
dotted
,
hidden
border-style
Width of a border around an
element
A numeric pixel value (such as
1px
), percentage
value, or the text values
thin
,
medium
,
thick
border-width
Distance up from the bottom (of
the containing element) to display
an element
A numeric value (
px
or
em
) or percentage
bottom
clear
Specifies the display of an element
in relation to floating elements
Text values
left
,
right
,
both
,
none
(default)
color
Text color
Any valid color
display
Controls how and if the element
will display
Text values
none
,
block
,
inline
,
list-item
. Display set to
"none"
causes
the element not to display.
float
Configures the horizontal place-
ment (left of right) of an element
within in a parent element
right
or
left
font-family
Name of a font or font family
Any valid font or a font family such as
serif
,
sans-serif
,
fantasy
,
monospace
, or
cursive
Size of the text font
This varies;
pt
(standard font point sizes),
px
(pixels), the unit
em
(which corresponds to
the width of the capital M of the current font),
or percentages; the text values
xx-small
,
small
,
medium
,
large
,
x-large
, and
xx-large
are also valid
font-size
Search WWH ::
Custom Search