1
我有直接从网站复制代码,直接将我的iframe放置到我的code.However创建一个类iframe似乎它不读取从CSS创建的类的值,但它会将代码直接粘贴到我的代码中,从而带来它自己的代码。 我如何重新调整我的Iframe的大小,以便它可以直接从类(CSS)准备好..我删除并删除了高度和宽度,并将其大小设置为不更改iframe的宽度和高度值
This是我的iframe代码
<div class="iframe">
<iframe src="https://sway.com/s/3HuzZFFkT18WUe4M/embed" width="100%" marginwidth="0" height="100px" marginheight="0" scrolling="no" frameborder="no" class="iframee" style="border: none; max-width:100%; max-height:100vh" allowfullscreen webkitallowfullscreen
mozallowfullscreen msallowfullscreen></iframe>
</div>
我的CSS - 这个宽度和高度都没有影响到代码
.iframe {
height: 100px;
width: 600px;
margin-left:auto;
margin-right:auto;
}
我今天偶然发现你的问题。引起我注意的是,您在iframe中使用了sway.com网站,这也是我现在正在尝试的。我想知道你的页面是否还在工作,因为它看起来像现在sway.com服务器正在设置X-Frame-Options到SAMEORIGIN,因此iframe什么都不显示。 – sm535