left column drops down in IE - Please help

Discussion in 'CSS' started by billybrag, Aug 10, 2006.

  1. #1
    billybrag, Aug 10, 2006 IP
  2. AdamSee

    AdamSee Well-Known Member

    Messages:
    422
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    135
    #2
    I believe you're suffering from Internet Explorer's double margin bug.

    Try the below code. It's targetted to windows only. Also, float your sidebar left rather than right.

    
    #content {
    	float:right;
    	margin:0 0 20px 20px;
    	width:480px
    }
    
    * html #content {display:inline;/*for IE*/}
    
    Code (markup):
     
    AdamSee, Aug 10, 2006 IP
  3. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #3
    @AdamSee: You don't need to hide it. A float element only recognizes two values for display, block and none. Inline is properly ignored by all browsers. No harm, no foul, and it does fix the bug.

    cheers,

    gary
     
    kk5st, Aug 10, 2006 IP
  4. AdamSee

    AdamSee Well-Known Member

    Messages:
    422
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    135
    #4
    Yeah, I know. However, I've been changing they way I code CSS recently and made a habit of separating all my patches/hacks from the rest of the pages (putting them in separate files) so I know where they are in the future.

    I find it's much tidier to code like that and lets others know that you're targetting a specific bug, helping them to learn quicker, rather than forgetting if it remains thrown in with the rest of the properties.
     
    AdamSee, Aug 11, 2006 IP
  5. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #5
    That's funny. I've gone the opposite direction, keeping the hacks close to the element and the standard styles. I find it easier to maintain and debug if style rules are kept together by context — with appropriate identifying comments, of course.

    I likely use more IE fixit hacks than I realize, but I do try to keep them to a minimum. Separating them from their contexts would create more opportunities for error, I would think.

    Whatever works best for each of us, but when I'm made King of the World, you'll have to clean up your act. :D

    cheers,

    gary
     
    kk5st, Aug 11, 2006 IP
  6. AdamSee

    AdamSee Well-Known Member

    Messages:
    422
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    135
    #6
    Haha, well being the king of the world, I guess you'd push the web further. Although I'd be one of those shady coders, coding in seperate files, hidden from society and the law...

    You won't catch me :p
     
    AdamSee, Aug 14, 2006 IP