Html 如何垂直居中facebook线条iframe
这个代码有什么问题?我无法使用任何样式将其垂直居中。我希望它使用样式属性,而不是修改cssHtml 如何垂直居中facebook线条iframe,html,css,iframe,Html,Css,Iframe,这个代码有什么问题?我无法使用任何样式将其垂直居中。我希望它使用样式属性,而不是修改css <iframe src="https://www.facebook.com/plugins/like.php?href=https://www.facebook.com/KOMPAScom&layout=button" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hi
<iframe src="https://www.facebook.com/plugins/like.php?href=https://www.facebook.com/KOMPAScom&layout=button" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:47px; height:20px"></iframe>
以下是我尝试使用style Attribute时的情况:
<iframe style="display: inline-block; vertical-align: middle;" src="https://www.facebook.com/plugins/like.php?href=https://www.facebook.com/feednews.id&layout=button" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:47px; height:20px"></iframe>
将iframe包装在div中,并使用text align:center设置样式
<div style="width:100%;text-align:center">
<iframe src="about:blank" style="border:none; overflow:hidden; width:47px; height:20px;"></iframe>
</div>
请注意,在同一元素中还有两个样式语句。只考虑其中一项。
注意“垂直”部分