I created a hero where the text is positioned to the left of an image, using flexbox to automatically position the text in the center of the div, relative to the image.
I used the old and new IE prefix to enable this to work on the latest version of IE, however it does not seem to be working on IE 10. The text div appears to be stretching through the full-width of the column, and behind the image on the right. Any ideas on why this is happening?
Code:
.hero {
background-color: #3c763d;
text-align: center;
}
.flex {
display: -ms-flexbox;
display: -moz-flex;
display: -webkit-box;
display: -moz-box;
display: flex;
-ms-flex-wrap: wrap;
-webkit-flex-wrap: wrap;
flex-wrap: wrap;
flex-direction: row;
}
.d-flex {
-ms-flex-align: center!important;
-webkit-box-align: center!important;
align-items: center!important;
display: -ms-flexbox!important;
display: -webkit-box;
display: flex;
margin-top: 0;
margin-left: auto;
margin-right: auto;
-moz-flex: 1 1 15em;
-webkit-box-flex: 1;
-ms-flex: 1 1 15em;
flex: 1 1 15em;
}
.img-responsive {
display: block;
max-width: 100%;
height: auto;
}
<section class="section hero">
<div class="container">
<div class="row flex">
<div class="col-xs-12 col-md-6 d-flex">
<div>
<h2>Headline</h2>
<p>Paragraph text</p>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div>
<img class="img-responsive" src="http://pngplay.com/wp-content/uploads/1/Laptop-PNG-Image.png">
</div>
</div>
</div>
</div>
</section>