Reputation: 8618
I have the following background image:
I want to use this as a background for a div, but to be placed at the bottom of the div and only to tile left to right, and not top to bottom. In addition, I want the background colour to the div to be #e4e5e6
, so the colour shows through where the transparent blocks are.
Here is my start:
HTML
<div class="tiles"></div>
CSS
.tiles {
width:100%;
height:400px;
background-color: #e4e5e6;
background: url('tiles-bg.png') bottom left fixed ;
background-repeat: repeat-x;
}
However, this approach centers the image in the center and still tiles top to bottom. It also fails to show the background color.
Upvotes: 0
Views: 1850
Reputation: 9476
Try putting all background related properties into one declaration, like this:
.tiles {
width: 100%;
height: 400px;
background: #e4e5e6 url('tiles-bg.png') bottom left repeat-x;
}
Upvotes: 1
Reputation: 171
for background propities, you should use somthing like this:
background: #e4e5e6 url('tiles-bg.png') bottom left fixed repeat-x;
You see, propeties "background" - is general, and when you use background-color, then after background, you turn off the property for background-color.
Upvotes: 0