I need container width min-height in order to hold variable size content, but at the same time I need content to be vertically aligned inside parent container.
JS Fiddle: http://jsfiddle.net/mr_goodcat/n5Pq3/6/
HTML:
<table class="mainLayout">
<tr>
<td>
<div class="contentLayout">
<div class="tbl">
<div class="tcell">
<div class="inner">
CONTENT
</div>
</div>
</div>
</div>
</td>
</tr>
<tr>
<td>
BOTTOM
</td>
</tr>
</table>
CSS:
body, html {
background-color: lightgreen;
height: 100%;
width: 100%;
}
.mainLayout {
height: 100%;
width: 100%;
}
.contentLayout {
width: 100%;
min-height: 200px;
border: 1px solid red;
display: block;
}
.tbl {
height: 100%;
width: 100%;
display: table;
}
.tcell {
width: 100%;
height: 100%;
background: purple;
display: table-cell;
text-align: center;
vertical-align: middle;
}
.inner {
display: inline-block;
}
Want to align purple box inside red square (min-height containter). How do I do that?
Try this http://jsfiddle.net/n5Pq3/30/ This is a known issue with webkit. The work around is to use
Want to look into more detail then follow this link …https://bugs.webkit.org/show_bug.cgi?id=26559