gpt4 book ai didi

css - 居中 iFrame

转载 作者:行者123 更新时间:2023-11-28 10:40:08 31 4
gpt4 key购买 nike

http://makememodern.com/portfolio/

您会看到我在页面上嵌入了一个网站,并且它与页面右侧对齐。我希望它居中。

<div style="text-align:center">
<iframe style="-webkit-transform: scale(0.7);" src="http://www.stokeswilliams.com" width="100%" height="700px"></iframe>
</div>

最佳答案

您将 iframe 的宽度设置为 1100 像素。包裹它的 div 具有动态宽度。

要解决这个问题,您可以设置 iframe 的宽度以匹配其父容器的宽度,方法是:

iframe {
width: 100%;
}

关于css - 居中 iFrame,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23171881/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com