css
css
Sheets (CSS)
CSS background-color
Example:
body {
background-color: lightblue;
}
CSS background-color
div {
background-color: lightblue;
}
p{
background-color: yellow;
}
Opacity / Transparency
div {
background-color: green;
opacity: 0.3;
}
Opacity / Transparency
div {
background: rgba(0, 128, 0, 0.3) /* Green background with 30% opacity */
}
CSS background-image
Example:
body {
background-image: url("paper.gif");
}
CSS background-repeat
By default, the background-image property repeats an image
both horizontally and vertically.
Some images should be repeated only horizontally or vertically, or
they will look strange
Example:
body {
background-image: url("gradient_bg.png");
background-repeat: repeat-x;
}
CSS background-repeat: no-repeat
Example:
body {
background-image: url("img_tree.png");
background-repeat: no-repeat;
}
CSS background-position
Example:
body {
background-image: url("img_tree.png");
background-repeat: no-repeat;
background-position: right top;
}
CSS background-attachment
The CSS border properties allow you to specify the style, width,
and color of an element's border.
CSS Borders
CSS has properties for specifying the margin for each side of an
element:
margin-top
margin-right
margin-bottom
margin-left
CSS Padding
CSS has properties for specifying the padding for each side of an
element:
padding-top
padding-right
padding-bottom
padding-left
CSS Padding
div {
padding-top: 50px;
padding-right: 30px;
padding-bottom: 50px;
padding-left: 80px;
}