Grow your CSS skills. Land your dream job.

margin-left not taking effect for IE

  • # November 28, 2012 at 1:19 am

    I’ve added a style tag to a table and had a margin-left that appears on Chrome and FF but not on IE 9. I did the double margin-left with the second one having the “!important” and still it’s not applied.

    # November 28, 2012 at 6:17 am

    We’d need to see the table in action. Do you have a link?

    # November 28, 2012 at 1:29 pm

    With the code you posted, it should not have a left margin in ANY browser, simply due to margin-left: 0 !important;.

    otc
    # November 28, 2012 at 10:09 pm

    Hello Pressuredat19,

    May I first suggest you use div tags instead of tables and then CSS instead of inline CSS and old HTML that are deprecated.

    If you choose to stick with the table you can still style it using CSS like so

    table {
    position: relative;
    width: 685px;
    height: 46;
    margin:0 auto; /* centers it*/
    margin-left: 0;
    border: 1px solid black;
    }
    td {
    padding: 1px;
    margin:1px;
    }

    This should solve your issues with multiple browsers. If it does not link us what you have :D.

    Good luck

    # November 29, 2012 at 1:01 am

    @otc Why are you suggesting divs instead of a table?

    How do you know he isn’t using a table properly?

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".