What do you do when you are trying to use a grid system (like say, 960 or blueprint or YUI) and the design contains a background image that clearly does not adhere to the columns OR gutters?

<div class="grid_4 my_background">
A background image...
</div>
.my_background {
background: url(someimage.jpg);
}
If i have understood your question, you should consider surrounding your grid div with a wrapping div (
gridWrapperin the example code below), and place anabsolutepositioned<img>(gridBackgroundin the example code below) into it, with az-indexgreater (if it must be looking like the picture you provided) or lower (if it is a proper background) than the underlying div containing the grid system.With the image in the
background-imagecss property you have no luck to control its size with IE7-IE8, since they do not support thebackground-sizeproperty (as you can see here).Using an
<img>element you are able to manipulate the size of this “background” according to the grid size.… and the css:
If your background image has squared proportions, you are fine with it. Otherwise, you have to take care of eventual distortions or empty spaces.
If you don’t care about IE7-IE8 for some reason, you can place your image as background by doing simply:
You can chose the
background-sizeproperty value that fits best your layout requirements by reading here.