在div标签中,通过css设定("height:50px;line-height:50px"),可以控制其中的文本处于垂直居中,但是,在<div> <script>.....</script> </div> 中,如何使<script>.....</script>中的内容在div 标签中处于垂直居中?
第1个回答 推荐于2018-04-12
你试试在这个div里插入table,把<script>.....</script>放入td中
<div>
<table border="0" cellpadding="0" cellspacing="0" style="margin-left:auto; margin-right:auto;">
<tr>
<td><script>.....</script></td>
</tr>
</table>
</div>
style="margin-left:auto; margin-right:auto;"是为了让table横向居中,td默认是垂直居中的本回答被提问者和网友采纳
<div>
<table border="0" cellpadding="0" cellspacing="0" style="margin-left:auto; margin-right:auto;">
<tr>
<td><script>.....</script></td>
</tr>
</table>
</div>
style="margin-left:auto; margin-right:auto;"是为了让table横向居中,td默认是垂直居中的本回答被提问者和网友采纳