Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何垂直居中facebook线条iframe_Html_Css_Iframe - Fatal编程技术网

Html 如何垂直居中facebook线条iframe

Html 如何垂直居中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

这个代码有什么问题?我无法使用任何样式将其垂直居中。我希望它使用样式属性,而不是修改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: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>

请注意,在同一元素中还有两个样式语句。只考虑其中一项。


注意“垂直”部分