The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Margin doesn’t work properly

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #40617

    I created my first website and I have a little problem. I created a div called “info” with some links in it, I styled it with margin-left and margin-bottom too. The fact is in Google Chrome/Safari work but in Mozilla and others don’t.

    You can see the links on the bottom’s page: Link

    Anybody can help me?

    Thank you!


    remove the space between the 20 and px


    Wow, didn’t know this ignoring by Firefox. Thank you very much guys!


    (in fact, this is exactly the sort of behavior that makes legacy versions of IE so problematic)

    ….and what gives more recent versions of IE a bad name. Very often, “bad” code (such as a closing tag missing) is being “fixed” by most browsers, but not by IE — which behaves correctly by NOT attempting to fix bad code.

    Just saying! :)


    @Senff I agree. I test my websites on IE6, because it renders invalid HTML as it is without any correction. For instance, invalid code such as a block level element within an online element is often “fixed” in “good” browsers, but it would “break” in IE6. IE6 lets me make my HTML more correct.


    First of all, there are two different specs being talked about here – CSS and HTML.

    The CSS specification clearly states how error handling is to occur (simply put, by ignoring the declaration). As traq points out, the browsers had correct implementation by ignoring the declaration (he also points out that webkit also ignored the declaration, but had the same property by default).

    HTML 4.01, on the other hand, states that there are no rules for error handling – user agents are free to interpret errors as they want, good or bad, right or wrong. That spec does give reference to notes on invalid documents in appendix B, but they’re just notes. Most every (if not all) browsers today have a [tag soup]( “”) parser to deal with errors – and again, each is free to interpret as they wish.

    Now html5 does have [error handling specs]( “”), but they’re not yet complete (I believe).

    So, you can defend IE all you want, but it’s no more correct than the other browsers. I can assure you that IE does indeed ‘fix’ errors – sometimes differently than other user agents, which in some instances you may like, but most don’t.

    The whole point is that developers have a responsibility to read, understand, and follow the specifications. And to run their pages through validators and to try their best to correct the errors encountered (hint to albertdt6).

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘CSS’ is closed to new topics and replies.