在 div 中,如何使<script>.....</script>的内容处于垂直居中?

在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默认是垂直居中的本回答被提问者和网友采纳

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网