【发布时间】:2020-06-01 16:43:14
【问题描述】:
我目前正在使用 sendgrid 的 prebuildt 电子邮件形式作为 iFrame。
一切都按预期工作。我遇到的唯一问题是,在移动设备上,iFrame 的内容太大而无法在屏幕上显示,正如您在图像上看到的那样:
所以我尝试用 scale: 0.5 调整内容的大小,但这只会使整个 iFrame 变小。
我当前的 CSS 代码如下:
.bg-modal {
width: 100%;
height: 100%;
position: fixed;
top: 0;
justify-content: center;
align-items: center;
}
.modal-contents {
height: 600px;
width: 600px;
background-color: white;
text-align: center;
position: relative;
border-radius: 4px;
}
.iframeClass{
width: 100%;
height:100%;
overflow:hidden;
}
我的 HTML 是这样的:
<div class="bg-modal">
<div class="modal-contents">
<iframe scrolling="no" class="iframeClass" frameborder="0" src="https://..."></iframe>
</div>
</div>
我不想显示滚动条。
有人知道这个响应问题的解决方案吗?
【问题讨论】:
标签: html css iframe responsive sendgrid