所以我在中心找到了位置内容的代码,但我的问题是它是为容器制作的,你知道如何为 iframe 制作这个吗?或者你知道另一个密码吗 代码:
.center {
margin: auto;
width: 60%;
border: 3px solid #73AD21;
padding: 10px;
}
<div class="center"></div>
这是我需要放入的代码。
<iframe src="http://80.213.62.138:12/playbutton.html"></iframe>
最佳答案
如果您想使用您的代码,请将 display:block
应用于 iframe,因为大多数浏览器将 iframe
读取为 inline
元素.
iframe {
margin: auto;
width: 60%;
border: 3px solid #73AD21;
padding: 10px;
display: block;
}
<iframe src="http://80.213.62.138:12/playbutton.html"></iframe>
关于html - 居中的 iframe 位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48360010/