HTML and CSS Reference
In-Depth Information
Fixing the background image
By default, background images are repeated. Luckily, there is a no-repeat value
for the background-repeat property. Also, by default, browsers position a
background image in the top left of the element, which is where we want it, but
let's also add a background-position property just to give it a try.
.guarantee {
line-height: 1.9em;
font-style: italic;
font-family: Georgia, "Times New Roman", Times, serif;
color: #444444;
border-color: black;
border-width: 1px;
border-style: solid;
background-color: #a7cece;
padding: 25px;
margin: 30px;
background-image: url(images/background.gif);
background-repeat: no-repeat;
background-position: top left;
The background-position property sets the position of the image and can be specified in pixels,
or as a percentage, or by using keywords like top, left, right, bottom, and center.
Places the im age in the top le ft of the element .
background-position: top left;
By default, a background image is “tiled,” or repeated over and over to fill the background space.
The background-repeat property controls how this tiling behaves.
Here a re the other backgr ound-repeat values y ou can use.
Display the ima ge once; don't
repeat the imag e at all.
Repeat the image only hori zontally.
background-repeat: repeat;
Sets the image to repeat both
horizontally and vertically. This is the
default behavior.
Search WWH ::

Custom Search