Ie7 and ie8 ignore "margin: 0px auto;"

http://blog.helpcurenow.org

I am working on the development of this blog and it seems that ie7 and ie8 both display content, so the container seems to ignore "margin: 0px auto"; The rule.

It may be something else that I just don’t get, but in any case, the effect is that the content (as well as navigation links) for some reason are floating to the left.

The strange thing is: a) it doesn’t happen at all in Firefox or Safari - well, is it really that strange? and b) it is not isolated from ie7, it seems that ie8 also does this.

I DO NOT WHY WHY ANY IDEAS?

Thanks!

+3
source share
4 answers

Your page is rendering in Quirks mode in IE because you have a comment:

<!--HOSTURL:blog.helpcurenow.org--><!--HOSTURL:blog.helpcurenow.org-->

before <!DOCTYPE ...>. DOCTYPE must be the first in the document, otherwise IE will ignore it.

If you delete this comment or move it after DOCTYPE, it works fine.

+12
source

Get rid of the comment "<!--HOSTURL:blog.helpcurenow.org--><!--HOSTURL:blog.helpcurenow.org-->"above. The doctrine must be the first after the HTTP headers, or IE goes into quirks mode (and does not understand jazz "margin: auto").

+4
source

RichieHindle - ! , get_header()! , , . 2 3 , .

!

0

Although the above is obviously the perfect answer, for some older and more obscure browsers, the only solution is to use the text alignment center reset. For example, if you want to place the 960px container in the center of the window, you can place the center of text alignment on your wrapper 100% wide, and then align the text to the left of the 960px container.

0
source

Source: https://habr.com/ru/post/1722507/


All Articles