如何水平居中的iframe? [英] How to center an iframe horizontally?
本文介绍了如何水平居中的iframe?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
考虑下面的例子:(现场演示)
HTML:
<div>div</div>
<iframe></iframe>
CSS:
div, iframe {
width: 100px;
height: 50px;
margin: 0 auto;
background-color: #777;
}
结果:
为什么 IFRAME
不集中对准像 DIV
?我怎么能集中对准了吗?
Why the iframe
is not centrally aligned like the div
? How could I centrally align it?
推荐答案
添加显示:块;
来您的IFRAME的CSS
Add display:block;
to your iframe css.
这篇关于如何水平居中的iframe?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文