TwelvestoneFront End

aligning divs and IE


Sign in

  • Waiting for Godot ( 720 k posts )
    Just conversation.
  • Thunder Dome ( 23 k posts )
    Photoshop Tennis and Collabs.
  • Photography ( 4.8 k posts )
    For all you shutterbugs, sh...
  • Flash ( 18 k posts )
    ActionScripting to tweens, ...
  • Front End ( 5.8 k posts )
    general front end design an...
  • Back End ( 9.6 k posts )
    serverside scripting, progr...
  • Projects and Theory ( 12 k posts )
    This forum is for discussio...
  • FAQ ( 269 posts )
    All those nagging questions...
  • Design ( 17 k posts )
    graphics & all aspects of g...
  • Purgatory ( 3.6 k posts )
    12stone Jail, feel free to ...
jestros
 
2009-10-22

Stupid IE. So I've got these boxes and I want them flush left. Works right in FF.

Top Box: div#horiz{ margin-left:1.5em;margin-top:1.5em;text-align:left;width:750px;background:#f1f4f7;padding:.5em; }

Bottom Box: div#vert{ margin-left:1.5em;margin-top:1.5em;text-align:left;float:left;width:150px;background:#f1f4f7;padding:1.5em; }

In Firefox: http://i37.tinypic.com/63rjvq.jpg In IE: http://i38.tinypic.com/25rcf82.jpg

creepylurker
 
2009-10-22

if its just ie6 then you have the old double margin bug. Adding _display:inline is the common fix.

jestros
 
2009-10-22

Originally posted by: creepylurker if its just ie6 then you have the old double margin bug. Adding _display:inline is the common fix.

Awesome, thanks man! I've found a few IE6 debugs, but I couldn't find that one. I could just ignore IE, but it will bug me when I'm trying to sleep at night. k

WingNut
 
2009-12-02

do you use a "reset.css"

JERKSTORE
 
2009-12-04

The other thing you can do is if you're floating in one direction, use margins on the other side. Not always possible depending on the layout obviously, but it's a simple fix when you can do it.

The double margin thing only happens if you're floating left and have a left margin, or floating right and have a right margin. Doesn't happen if you float left but have no left margin.

Just FYI.

Sorry, you must be a member to post to a conversation. Either log in or sign up to get involved.
TwelvestoneFront End

aligning divs and IE