Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

IE6 Margin/Padding problem

  • 20-06-2008 03:53PM
    #1
    Registered Users, Registered Users 2 Posts: 2,793 ✭✭✭


    Hi,

    I have a problem in IE6 whereby I have a container floated on the right of the page, with 0 margin & 0 padding. However, there is still a gap of between 5-10 pixels between the div container and the right hand side.

    In IE7 & Firefox everything is fine and the page looks perfect.

    The CSS styles are as follows:

    The container is located within #ContentSection:

    #ContentSection {
    width:745px;
    float:right;
    padding-top:3px;
    padding-bottom:2px;
    margin-left:0px;
    margin-right:0px;
    padding-left:0px;
    padding-right:0px;
    }

    The container itself is:

    .OTCRightCol
    {
    float:right;
    width:210px;
    margin:0px;
    padding:0px;
    }

    I have included screenshots to show you how it's meant to look and how it actually looks.

    Would appreciate any suggestions as I'm just about out of them! :(


Comments

  • Closed Accounts Posts: 8,866 ✭✭✭Adam


    How does your html and body tag look? Try putting
    html, body {
    margin: 0;
    padding: 0;
    }
    

    at the top of your css.


  • Registered Users, Registered Users 2 Posts: 2,793 ✭✭✭John_Mc


    Mirror wrote: »
    How does your html and body tag look? Try putting
    html, body {
    margin: 0;
    padding: 0;
    }
    

    at the top of your css.

    Hi,

    Thanks for your reply - I tried that but no luck :(


  • Closed Accounts Posts: 1,200 ✭✭✭louie


    have you any other "body" tag in your css file?


  • Registered Users, Registered Users 2 Posts: 2,793 ✭✭✭John_Mc


    louie wrote: »
    have you any other "body" tag in your css file?

    I have 2 stylesheets, one for FF & IE 7. I have a HTML conditional comment which loads a stylesheet for IE6 after this so any styles in that over-ride the main stylesheet.

    The Body tag for IE7/FF is:

    body {
    background-color: #ebece6;
    }

    Adding that other Body tag to IE6 should be alright.. shouldn't it?


  • Closed Accounts Posts: 8,866 ✭✭✭Adam


    Oh well if you already have seperate stylesheets why not just add a line to the css for IE6 saying margin-right: -10px; ?


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 2,793 ✭✭✭John_Mc


    Mirror wrote: »
    Oh well if you already have seperate stylesheets why not just add a line to the css for IE6 saying margin-right: -10px; ?

    Haha nice one, that worked a treat! :D

    Never had to use negative margin before, thanks a million for the help - you saved me a lot of banging my head against the wall!


  • Closed Accounts Posts: 18,163 ✭✭✭✭Liam Byrne


    John_Mc wrote: »
    Hi,

    I have a problem in IE6 whereby I have a container floated on the right of the page, with 0 margin & 0 padding. However, there is still a gap of between 5-10 pixels between the div container and the right hand side.

    It sounds like it's some variation of the IE6 double-margin float bug ? Try adding display:inline to the CSS for that object, and see if that solves the problem.

    Liam


Advertisement