3RD LESSON 4 CSS Posiition and Float
3RD LESSON 4 CSS Posiition and Float
Positionin
1
g
2
POSITION PROPERTY
- allows placing an
object or element
precisely on a page.
There are 4 position
schemes that you can
use static, relative,
absolute and fixed.
3
CSS POSITION
PROPERTY
PROPER
TY
VALUE DESCRIPTION
PROPERTY
PROPER VALU DESCRIPTION
TY E
float: left Floats to the left and all
other elements near it
will float away from the
block
float: right Floats to the right and all
other elements near it
will float away from the
block
float: none Elements will take the
space it requires, and
9
CSS TABLE
PROPER VALU DESCRIPTION
TY E
border- collaps sets whether the table
collapse e borders should be
collapsed into a single
border
Sample:
table { border-collapse: collapse; }
border shortc Width, style and color
ut
Sample:
table { border: 1px solid blue; }
10
CSS tr:hover
PROPER VALU DESCRIPTION
TY E
Background Any highlight table rows on
-color color mouse over
Sample:
tr:hover { background-color: orange; }
11
CSS tr:nth-child()
PROPER VALU DESCRIPTION
TY E
background Any For zebra-striped tables,
-color color use the nth-
child() selector and add
a background-color to all
even (or odd) table rows:
Sample:
tr:nth-child(odd) { background-color: pink; }