I am learning responsive design. Till now I know just a few things and am facing a problem.
I made 3 flex boxes, which work but when I am trying to view it on Internet Explorer 9 or less then everything breaks and the boxes are not displaing correctly!
How can I fix this issue? Here is my code on CodePen:
<html>
<head>
<title></title>
<meta charset="utf-8">
<style>
* { margin:0; padding:0; border:0; }
body { color: #535353; background: #e7e7e7; }
#container { background-color:green; width: 80.83%; margin: 0 auto; }
#header { color: #e8e8e8; background: #5e5e5e; padding: 5px 8px; }
.ptext {
font-size: 1em;
line-height: 1.20em;
margin: 1em 1em 1em 1em;
text-align: justify;
}
.containerbox {
font-size: 14px;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
}
.containerbox > div {
vertical-align: top;
width: 33.33%;
border: 1px solid grey;
box-sizing: border-box;
text-align: center;
border-radius:5px;
margin:5px;
background-color:silver;
}
@media (max-width: 996px) {
.containerbox {
display: block;
width: 100%;
margin:0px;
}
}
@media (max-width: 996px) {
.containerbox > div {
display: block;
width: 100%;
margin:0px;
}
}
@media (max-width: 996px) {
#header {
text-align: center;
}
}
</style>
</head>
<body>
<div id="container">
<div id="header">
<h1>Test 3 flex boxes</h1>
</div>
<div id="main">
<div class="containerbox">
<div><p class="ptext">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut urna justo, codetium at malesuada a.</p></div>
<div><p class="ptext">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut urna justo, codetium at malesuada a.</p></div>
<div><p class="ptext">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut urna justo, codetium at malesuada a.</p><</div>
</div>
</div>
</body>
</html>
http://codepen.io/anon/pen/RoNzNO
Please give me some solutions how I can fix it in IE9.