Html 显示水平居中的iFrame
我在php中有一个iFrame,我想至少将它显示为水平居中,这是我的代码。如何编辑它使其在浏览器中显示水平中心Html 显示水平居中的iFrame,html,Html,我在php中有一个iFrame,我想至少将它显示为水平居中,这是我的代码。如何编辑它使其在浏览器中显示水平中心 <!DOCTYPE html> <html class="no-js" lang="en"> <head> </head> <body> <div> <iframe src="https://<??>" width="850" target="_parent" height="850" scro
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
</head>
<body>
<div>
<iframe src="https://<??>" width="850" target="_parent" height="850" scrolling="no" style="overflow:hidden; border:none;" style = "display:block;"></iframe>
</div>
</body>
</html>
您有两个独立的样式标记。一定要把它们合并成一个
尝试添加边距:0自动代码>到您的样式标记
您需要将iframe放在div中,然后使用css在div中居中,如下所示:
<div class="myframe">
<iframe src="http://google.com" width="850" target="_parent" height="850" scrolling="no" border:none;></iframe>
</div>
<style type="text/css">
.myframe
{
margin: 0px auto;
width: 850px;
}
</style>
.我的框架
{
保证金:0px自动;
宽度:850px;
}
删除额外的样式属性,合并为一个:style=“border:none;width:850px;margin:20px auto;”