Possible Duplicate:
Convert HTML + CSS to PDF with PHP?
I can’t seem to find a way to accomplish this properly. I have two containers. In one container I want to use a background image that will take over the entire top half horizontally and then I want to use a second container and color it red. This will take over the bottom half horizontally.
I tried this:
HTML:
<div class="container1">
Some text and other divs go here. This is where the background will be an image.
</div>
<div class="container2">
Some text will also here along with divs. This is where I want to use the red background.
</div>
CSS:
.container1 {
background-image: url('img.png');
width:100%;
}
.container2 {
width: 100%;
color: #990000;
}
The problem is that for the image container I am left with whitespace on the top,
bottom, left, and right.
How do I solve this?
You need to set padding and margins to 0. Most experienced UI developers will use what is known as a CSS reset, to eliminate any browser-specific default stylesheet behaviors (like giving padding.
For your purpose a basic CSS reset of:
at the beginning of your CSS file, should help.
Also, CSS
coloris related to teh text color, not the background color. You need to usebackground-color.