Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Cascading Style Sheets _ Problem with background image alignment

Posted by: kierdraven Apr 1 2012, 10:25 PM

Hi there,

I am new to thie forum so i'll start off with saying Hello! I am an intermediate skill levelled web designer that does it for a hobby, not professionaly.

Anyhow, here's my problem. I'm building the next version of my website, and having issues with the background image being aligned to "true" center. My background image is just black with a couple of vertical lines that are to run seemlessly down the page, bordering the content that sits in the middle. I have an image at the top of the page that has a couple of lines at the base of it to align with the background image, but they just will not line up. It appears the actual background image is JUST off center, and I can't for the life of me get it to align properly.

Here's my BODY code in CSS:

CODE
body { background:url(***); background-color: #000; background-repeat:repeat-y; background-position:center; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px;}


I'm testing this in Google Chrome on a Windows XP PC. The same problem occurs in Apple Safari. In Mozilla Firefox it displays fine, however there is a different issue with the table that i'll address in another area of these forums lol. Any help/tips would be appreciated!

Thanks.

EDIT: I have enabled border="1" on the table so you can see the alignment issue.

Posted by: pandy Apr 1 2012, 10:54 PM

Hi! smile.gif

I think I see it in Safari Win, but not in Iron (which should be the same as Chrome but without the spying, or so they say). The background is a little bit to the right, is that what you see? Or the table is a bit to the left, whichever it is.

Posted by: kierdraven Apr 1 2012, 10:57 PM

Hi! smile.gif

Yes, the background is a bit to the right so not quite "center" as i'm instructing it in my CSS code. I'm pretty confident the table is true "center"...

QUOTE(pandy @ Apr 2 2012, 03:54 PM) *

Hi! smile.gif

I think I see it in Safari Win, but not in Iron (which should be the same as Chrome but without the spying, or so they say). The background is a little bit to the right, is that what you see? Or the table is a bit to the left, whichever it is.

Posted by: kierdraven Apr 1 2012, 11:05 PM

I think i may have fixed it!

specifying the following CSS seems to have helped!

CODE
table { table-layout:fixed;}

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)