首页 > 解决方案 > 如何删除滚动并适合响应式屏幕?

问题描述

  .iframe-container {
  overflow: hidden;
  padding-top: 56.25%; /* 16:9*/
  position: relative;
}

.iframe-container iframe {
   border: 0;
   height: 100%;
   left: 0;
   position: absolute;
   top: 0;
   width: 100%;

  <div class="iframe-container">
  <iframe width="560" height="315" src="https://ytj861vz7v7n6opm7n9xwq-on.drv.tw/HTML%20Coding/jotform.html" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" loading="lazy" allowfullscreen></iframe>
</div>

我也在 CSS 中试过这个:

溢出:隐藏;这不起作用

这也不是响应式的有没有一种方法可以删除滚动条,同时仍然可以滚动整个页面?

请只使用 CSS 或 HTML。

标签: htmliframe

解决方案


推荐阅读