Search code examples
htmlcssblueprint-css

why does the page display differently in IE than google chrome?


Certain pages display terribly in IE generally, what is the best approach to solving these issues?


Solution

  • You forgot to add a doctype, so your page is in Quirks Mode.

    Add this (the HTML5 doctype) as the very first line:

    <!DOCTYPE html>
    

    and it should look better.

    Although, changing the Document Mode manually (using Developer Tools; hit F12), it still doesn't look right. There are evidently other problems with the page.


    The most pertinent problem (after escaping Quirks Mode) is this:

    <body style="margin: 0; padding; 0;background-color: 4DA2CA;">
    

    Internet Explorer is not showing any background colour because you forgot the # before the colour. (And you have padding; 0, with a ; instead of :)

    This will work:

    <body style="margin: 0; padding: 0; background-color: #4DA2CA">
    

    But you shouldn't be using inline styles in the first place..

    This would be better:

    <body>
    

    with CSS in your stylesheet:

    body {
        margin: 0;
        padding: 0;
        background-color: #4DA2CA
    }