Log in

View Full Version : Centering layout in IE, and make background image go all the way down



Briggs
04-01-2008, 04:04 PM
Hey, I'm working on a new layout for my site, and I'm using a CSS based template.
But I've got two problems,

1. it looks awesome on Firefox, but it isn't centering on internet explorer, how do I fix this?

2. I'm using a background image for my different sections, but I really want them to stretch all the way down the page in stead of just stopping when there isn't any content left.

I tried looking on http://www.w3schools.com/css/default.asp but I didn't really see anything that helps :(

this is my css:
<edited>

I didn't write this myself, I modified an exciting template

NXArmada
04-01-2008, 06:31 PM
Using



margin: auto;


in your body portion



body {
float: center;
background: #830109;
color: #000000;
font: normal 62.5% "Lucida Sans Unicode",sans-serif;
margin: auto;
}


should do the trick and lose the float: center; it is not needed.

Briggs
04-01-2008, 08:48 PM
sadly that didn't work :(

rangana
04-02-2008, 04:38 AM
Do you have a DTD (http://alistapart.com/articles/doctype) on your page ;)
Have you had something similar to this above you html tag:


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">


If nothing works, together with the margin:auto;, then a live page or your code could get this easy :)

See if it helps ;)

Medyman
04-02-2008, 06:17 AM
to center content within the <body> tags use text-align:center.

In regards to the 100% height background, some HTML code would be helpful. It really depends on how your divs are layed out.

Briggs
04-02-2008, 03:28 PM
Do you have a DTD (http://alistapart.com/articles/doctype) on your page ;)
Have you had something similar to this above you html tag:


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">


If nothing works, together with the margin:auto;, then a live page or your code could get this easy :)

See if it helps ;)

*sighs* I don't know how I could have missed this :p