Background Images

If you’d like to add a background image to any element on your page, you do so via the CSS:

header {
background: url('dog.jpg');
}

This assumes,  in this case, that ‘dog.jpg’ is in the same folder as your HTML page.

Background images tile, by default, meaning the repeat infinitely both horizontally and vertically. You can stop or adjust this via CSS:

background-repeat: repeat-x; /*only repeat horizontally */
background-repeat: repeat-y; /*only repeat vertically*/
background-repeat: no-repeat; /*do not repeat */
This entry was posted in Uncategorized. Bookmark the permalink. Follow any comments here with the RSS feed for this post. Both comments and trackbacks are currently closed.