I am encountering an issue with displaying divs at 100% height in Internet Explorer. The code works perfectly in other browsers, but for some reason IE is causing me trouble and I'm struggling to find a solution.
Here is a snippet of my code:
HTML:
<div id="content">
<div id="box-01" class="slide" style="color: #F26964; background-color: #003218;">
<div class="text-content">
TEXT GOES HERE
</div>
</div>
<div id="box-02" class="slide" style="color: #F2F1EF; background-color: #70858E;">
<div class="text-content">
TEXT GOES HERE
</div>
</div>
<div id="box-03" class="slide" style="color: #F2F1EF; background-color: #003218">
<div class="text-content">
TEXT GOES HERE
</div>
</div>
</div>
CSS:
html, body {
margin:0;
padding:0;
height:100%;
border:none
}
#content {
width: 100%;
height: 100%;
margin: 0;
position: absolute;
top: 0px;
left: 0px;
}
.slide {
width: 100%;
height: 100%;
margin: 0 auto;
text-align: center;
position: relative;
display: table;
vertical-align: middle;
background: no-repeat 50% 50%;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.text-content {
text-align: center;
display: table-cell;
vertical-align: middle;
text-transform: uppercase;
}
I have a series of relatively positioned divs, each set to fit the size of the browser window. While this setup functions correctly in most browsers, IE seems to have difficulty recognizing the 100% height style attribute. My research indicates that this may be related to the text being in a table format (which is necessary for centering the text both horizontally and vertically). However, I am unsure how to address this issue. Any suggestions or solutions would be greatly appreciated!