bgoodin Posted July 10, 2009 Report Share Posted July 10, 2009 I'm learning CSS as I work through my current project and I've run into an issue with my header div. http://www.mjkelly.com/new/anothertest.html is the site. I have the header div width set to 100% and it looks fine until I 'restore' my window to a smaller size. At that point, the background image ends when the content (header image), leaving a white space to the right. Anyone have any ideas on how to fix it so that the div background image stays the width of window, no matter the size. Also, any comments on the CSS would be appreciated. Thanks! Brandon Quote Link to comment Share on other sites More sharing options...
Wickham Posted July 13, 2009 Report Share Posted July 13, 2009 (edited) Delete the width: 100% #header { position:absolute; /*width:100%;*/ height: 170px; background-image:url(images/header_bg.jpg); margin:0 0 0 0; } width: 100% means that it starts at 100% of the window, but you have a horizontal scrollbar and when you scroll, the background moves away from the right side maintaining its original position; I tested and found that deleting the width: 100% made it continue as far right as it needs to. Edited July 13, 2009 by Wickham Quote Link to comment Share on other sites More sharing options...
bgoodin Posted July 14, 2009 Author Report Share Posted July 14, 2009 Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.