0

CSS file: http://pastebin.com/tBvGjhTX
HTML file: http://pastebin.com/r5YUTHgp

I have a div with following rules:

{
    width: 75%;
    margin: 5% auto;
}

Obviously works everywhere except Microsoft Internet Explorer 0.5 to Edge. While in every normal browser, box takes 75% of width and is centered horizontally. But Microsoft be like "screw that", and in Internet Explorer box takes 100% the width of the parent. Any other dependencies, removing them or keeping them doesn't change anything.

2
Contributors
10
Replies
42
Views
1 Year
Discussion Span
Last Post by gentlemedia
Featured Replies
  • okay, i've found the issue. In head.php you have a CSS reset and the css rule that sets the new HTML5 elements to `display: block` misses the main tag, so add the main tag there and it will center in IE. Below I've added the main tag so you can … Read More

  • see here why and read note 2 http://caniuse.com/#feat=html5semantic Read More

0

Ah, good you reminded me, I added <!DOCTYPE html>.
However, that still does not solve the problem.

0

Yes. I know it works with Internet Explorer 9+ normally. That's why I used it. Because I expected it to work, and it doesn't. I don't know what part does or does not work with it.

1

okay, i've found the issue. In head.php you have a CSS reset and the css rule that sets the new HTML5 elements to display: block misses the main tag, so add the main tag there and it will center in IE. Below I've added the main tag so you can see what I'm talking about :)

article,aside,details,figcaption,figure,footer,header,hgroup,menu,main,nav,section{display:block}

Instead you can also add display: block in your own stylesheet of the main CSS rule.

Edited by gentlemedia

0

Yep, it works.

Still pretty stupid though, every single browser does it, except IE... I don't know what I expected.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.