SitePoint Enthusiast
background image display issue
Why does the image not fill the viewport when I make it a background image using css? I get a display like this http://www.sbmusclecars.com/index2.php .
here is the css that I wrote
.header {
width: 100%;
height: 185px;
background-image: url('http://www.sbmusclecars.com/images/upperheader.gif');
background-repeat: no-repeat;
margin: 0px 0px 10px;
}
But when I use code like this
<a href="/index.php">
<img src="images/upperheader.gif" width="100%" alt="" />
</a>
it displays as I want as shown here www.sbmusclecars.com/index.php
If you need more information please let me know and thanks in advance for the assistance.
I do not see a difference. Do not know if you fixed it.
You have this background-repeat: no-repeat;
It will not fill.
Use:
background-repeat: repeat-x;
or remove it to fill full screen.
Added repeat-x after the background image so that the image repeats across the X axis (horizontally).
Give this a try and see if it works for you.
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks