Monday, February 1, 2016

Set the html height to 100%; to accomodate old IE.

Have you ever tried to make something hang out midpage only to find it all smashed against the top in old versions of Internet Explorer? Me too. I had a table cell 100% tall and wide to cover the whole page and I was trying to put onto it styles like...

.whatever {
   vertical-align: middle;
   text-align: center;
}

 
 

...to kick into life this line effect which just wasn't working for some infuriating reason...

<td width="100%" height="100%" valign="middle" align="center">

 
 

...but of course the last place that is gonna work is in old IE. Something else was wrong. It turns out that the fix looks like this:

html {
   height: 100%;
}

No comments:

Post a Comment