Ask coding questions

← Back to all posts
Html backrounds
SanjayGold (1)

How do I add a html image backround

Comments
hotnewtop
Coder100 (18191)
background: url(<img>);

Replace <img> with the url of the image!

notGilbert (121)

CSS background-image

#selector {
  background-image: url('insert-image-url-here');
  /* more options to control how the background is displayed */
}
EdwardBentler (36)

First, create the image,

<img src='cat.png'></img>

Then go to the style.css file and type this:

img {
height: 100%;
width: 100%;
z-index: -100;}