Topic: Negative Margins or Auto Margins? Pages that link to <a href="https://ozoneasylum.com/backlink?for=26732" title="Pages that link to Topic: Negative Margins or Auto Margins?" rel="nofollow" >Topic: Negative Margins or Auto Margins?\

 
Author Thread
Schitzoboy
Maniac (V) Inmate

From: Yes
Insane since: Feb 2001

IP logged posted posted 09-28-2005 01:38 Edit Quote

So I know how to horizontally center a div with negative margins and with auto margins. With auto you gotta use the nasty opera/IE hack. Which method do you guys use and why the preference. I tend to use negative margins but I wanna know if I missing out on something =)

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

IP logged posted posted 09-28-2005 02:44 Edit Quote

Auto. The negative margin trick requires absolute positioning (IIRC), which is hard to work with as a part of a larger whole.


 

reisio
Paranoid (IV) Inmate

From: Florida
Insane since: Mar 2005

IP logged posted posted 09-28-2005 05:42 Edit Quote

...nasty opera/IE hack?

I've never wasted time trying to debug for Opera, but I know that IE(6) can handle margin: 0 auto; just fine.

Blaise
Paranoid (IV) Inmate

From: London
Insane since: Jun 2003

IP logged posted posted 09-28-2005 10:48 Edit Quote

If you're talking about using text-align: center; on the parent element, I'd hardly call that a hack, but anyway, that's the way I center div's using the margin 0: auto; technique.

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

IP logged posted posted 09-28-2005 13:02 Edit Quote

I like to use the negative margin for its simplicity, but I've noticed ( can't remember if that was in IE or FF ) that if the window is too small half of the content goes outside. Well it goes crazy.

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

IP logged posted posted 09-28-2005 15:19 Edit Quote

the negative margin method feels to much like a hack for my tastes.

Always margin:auto; for me.



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu