Professional Documents
Culture Documents
backgrounds
learn how to apply colors and
background colors to your websites.
advanced methods to position and
control background images.
'background-color' property
describes the background color of elements
The element <body> contains all the content of
an HTML document. Thus, to change the
background color of an entire page, the
background-color property should be applied to
the <body> element.
body {
background-color: #FFCC66;
}
background-image property
background-repeat
property
Value
Description
background-repeat:
repeat-x
The image is
repeated
horizontally
background-repeat:
repeat-y
The image is
repeated
vertically
The image is
background-repeat:
repeated both
repeat
horizontally
and vertically
background-repeat: The image is not
no-repeat
repeated
background-repeat
to
background-attachment
property
attachment specifies
whether a background
picture is fixed or scrolls
along with the containing
element.
A fixed background image
will not move with the text
when a reader is scrolling
the page, whereas an
unlocked background
image will scroll along with
the text of the web page.
Value
Description
Backgroundattachment:
scroll
The image
scrolls
with the
page unlocked
Backgroundattachment:
fixed
The image is
locked
background-attachment
For
Summary
You
Fonts
learn
Fonts
The
font-family
font-style
font-variant
font-weight
font-size
font
font-family
font-style
defines
font-variant
is
font-variant
If
font-weight
describes
font-size
There
Summary
Remember
Text
Formatting
Text
The
text-indent
text-align
text-decoration
letter-spacing
text-transform
text-indent
allows
text-align
corresponds
text-align
In
text-decoration
makes
letter-spacing
text-transform
controls
text-transform
Try
li {text-transform: capitalize;}
Links
You
What is a pseudo-class?
A
pseudo-class
color: blue;}
color: red;}
Pseudo-class: link
used
Pseudo-class: visited
is
Pseudo-class: active
used
Pseudo-class: hover
Identification and
grouping of elements
(class and id)
The id selector
This
Grouping of elements
(span and div)
use
Application
Margin
An
Margin
Padding
Padding
Padding
Borders
can
border-width
border-color
border-style
border
border-width
width
border-color
color
border-style
There
Example
Summary
the
Floating elements
An element can be floated to the
right or to left by using the property
float.
That is to say that the box with its
contents either floats to the right or to
the left in a document
The principle:
The result:
How is it done?
The HTML file:
Positioning of
elements
With CSS positioning, you can
place an element exactly where you
want it on your page.
Together with floats positioning
gives you many possibilities to create
an advanced and precise layout.
principle
behind CSS
positioning is
that you can
position any
box anywhere
in the system of
coordinates.
Example
Absolute positioning
An
Example
As
Relative positioning
To
Example
Z-index
,you
can assign each element a number (zindex). The system is that an element with a
higher number overlaps an element with a
lower number.
Example
Summary
Layers
Web-standards and
validation
Web-standards
W3C
Web-standards
If
Web-standards
CSS validator
To