我想把文字放在中间。垂直它在中间但水平不是。我错过了什么?这是 FIDDLE
<div style="display: table; height: 600px; overflow: hidden;text-align: center">
<div style="display: table-cell; vertical-align: middle;
text-align: center;" class="dlgImg">this is text</div>
</div>
最佳答案
用这个
<div style="display: table; height: 600px; overflow: hidden;text-align: center;width:100%">
<div style="display: table-cell; vertical-align: middle;text-align: center;" class="dlgImg">this is text</div>
</div>
关于HTML:将文本放在中心,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22243423/