[RESOLVED] Background image fixed width
Hi Everyone. I'm new here, so if I seem like a moron, I probably am
I have a question about fixing the width on my background image. I searched the threads, but didn't find exactly what I was looking for.
You can see the problem here: http://www.webitseo.com
I want the header image to only be as wide as the content area, instead of stretching across the whole screen. Here is my css:
font: 85% "Trebuchet MS", Arial, Helvetica, sans-serif;
Can anyone help with this? I want the image to repeat-x, but only to the width of the content. I tried setting the width in the body element, but that didn't help, infact it made things worse because it moved all the content to the left of the screen. Is there a way to fix the width of the repeat of an image?
Your problem is that you are setting the background image in the BODY tag.
What you want to do is set up a DIV that is the same width as your content area and the same hight as the green line. Inside that DIV will go the green portion of your background (so you'll have to cut that part out of the current background image). Then you just set that as the background of the DIV.
But if you want my opinion, I say leave it the way it is. I think it looks better spanning across the whole screen.
Thank you very much for your help, Swasstastic! I will try it. And thanks for the comment. Maybe I'll just leave the green bar the way it is. But it's good to know how to sort these problems out. I love CSS, but it can be a bugger sometimes.
Last edited by Webitseo; 02-24-2009 at 08:28 AM.
Reason: Wanted to clarify who this was in response to
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)