Is it possible to set the size of the background image with CSS?
I want to do something like:
background: url(\'bg.gif\') top repeat-y;
background-si
Not possible. The background will always be as large as it can be, but you can stop it from repeating itself with background-repeat.
background-repeat: no-repeat;
Secondly, the background does not go into margin-area of a box, so if you want to have the background only be on the actual contents of a box, you can use margin instead of padding.
Thirdly, you can control where the background image starts. By default it's the top left corner of a box, but you can control that with background-position, like this:
background-position: center top;
or perhaps
background-position: 20px -14px;
Negative positioning is used a lot with CSS sprites.