View Full Version : margin: auto for ie
06-01-2007, 05:36 AM
I have a background image that repeats to border the left and right side of my content... the content is wrapped with
and in mozilla it works.. as usual.. in IE it looks like it needs to be shifted 5px right.
What do I do?
06-01-2007, 06:15 AM
Well first of all to simplify your code you can use
margin: 0 auto;
The way I get IE to behave properly is to make another <div> to wrap around the other one with a text-align:center;
So it will look like:
margin: 0 auto;
And simply nest the .wrap800 inside the .wrapper div. Hope this helps.
06-01-2007, 08:53 AM
Uhm… not sure if this is a good idea as you are adding a useless empty div. Can you post a link to your problem (for better imagination thereof)?
06-01-2007, 09:15 AM
Its your doctype. You are either lacking one or using a partial one. Coding properly to begin with saves from dealing with simple issues like this. Use a full doctype. I recommend this one
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
Also I recommend using different naming techniques on your class and/or ids. They need to be descriptive but something like wrap800 doesn't work to well because what if you decide to go bigger or smaller? Sure its probably only there one time but for other classes and ids you'll have to change them. Make them meaningful.
06-14-2007, 07:00 PM
I totally agree with you... That was a quick and dirty thing. Thanks for the help.. it works
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.