Reputation: 69
I have run into a problem where IE is not rendering my page correctly.
Here is the site: Cakeball Flavors
Google Chrome
Internet Explorer 11
Basically I'm trying to make the main
element 1000px wide, but internet explorer is failing to accomplish this. I'm utilizing max-width of 1000px and width of 100% for a fluid layout, but IE seems to be ignoring it. I've double-checked the code inspection in both browsers to ensure that nothing is overriding it.
Markup
...
<body>
<header>
...
</header>
<main>
<header>
<h1>Flavors</h1>
</header>
<h2>Basic</h2>
<figure>
<img src="...">
<figcaption></figcaption>
</figure>
...
</main>
...
Style
...
body {
margin: auto;
background: white;
text-align: center;
}
main {
width: 100%;
max-width: 1000px;
margin: -1rem auto -1rem;
text-align: left;
}
Upvotes: 1
Views: 2076
Reputation: 69
Thanks to @steveax, I was able to figure out the problem is IE's lack of support for the main
element. After a further 30 minutes of research and testing I came up with a solution.
In my head tag, I added the following code above all my css links:
<script>document.createElement('main');</script>
In my stylesheet I added:
main { display: block; }
Now the page correctly renders in Internet Explorer (10 & 11 at least).
Upvotes: 1