这是我的问题JSFiddle的链接。我正在使用.center-y类来尝试垂直居中文本元素,但没有结果。
.center-y {
vertical-align: center;
}
答案 0 :(得分:2)
删除max-height并放置顶部和底部边距我希望这对你有帮助
#WhatIsMasterPhoto {
margin:25% auto;
bottom: 10px;
}
答案 1 :(得分:0)
检查更新的jsfiddle - http://jsfiddle.net/chetangawai/2LKXQ/2/
<!-- What is Master Page -->
<div class="container-fluid" style="display: table;" id="WhatIsMastercontainer"><!--updated-->
<div class="col-md-6 center-y" id="WhatIsMasterText" style="display: table-cell;
vertical-align: middle;"><!--updated-->
<div class="container-fluid-text" , id="SubHeaderTextLeft">What is a Master?</div>
<div class="container-fluid-text" , id="RegularTextLeft">Here's a bunch of test text. Here's a bunch of test text. Here's a bunch of test text. Here's a bunch of test text. Here's a bunch of test text. Here's a bunch of test text. Here's a bunch of test text. Here's a bunch of test text. Here's a bunch of test text. Here's a bunch of test text. Here's a bunch of test text.
<br>
<br>Here's a bunch of test text. Here's a bunch of test text. Here's a bunch of test text.</div>
</div>
<div class="col-md-2 col-md-offset-2 center-text">
<img id="WhatIsMasterPhoto" src="http://sisu.typepad.com/photos/uncategorized/2008/08/20/spongebob_yo.jpg">
</div>
</div>