html - Iframe 响应顺风

标签 html css iframe

我正在尝试使用 tailwind 将 iframe 放入 div 中,但我不知道如何使 iframe 响应。

我需要使用什么样的类才能使以下内容正常工作?

<div class="min-h-screen bg-gray-50 py-6 flex flex-col justify-center relative overflow-hidden sm:py-12">
  <img src="/img/beams.jpg" alt="" class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 max-w-none" width="1308" />
  <div class="absolute inset-0 bg-[url(/img/grid.svg)] bg-center [mask-image:linear-gradient(180deg,white,rgba(255,255,255,0))]"></div>
  <div class="relative px-6 pt-10 pb-8 bg-white shadow-xl ring-1 ring-gray-900/5 sm:max-w-lg sm:mx-auto sm:rounded-lg sm:px-10">
    <iframe src="https://www.geogebra.org/calculator/zsnkxfmw?embed" width="800" height="600" allowfullscreen="" style="border: 1px solid #e4e4e4;border-radius: 4px;" frameborder="0"></iframe>
  </div>
</div>

最佳答案

有官方插件https://github.com/tailwindlabs/tailwindcss-aspect-ratio

// tailwind.config.js
module.exports = {
  theme: {
    // ...
  },
  corePlugins: {
    aspectRatio: false,
  },
  plugins: [
    require('@tailwindcss/aspect-ratio'),
    // ...
  ],
}

或者您可以引用https://tailwindcss.com/docs/aspect-ratio

关于html - Iframe 响应顺风,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71286857/

相关文章:

javascript - 如何将 SPAN 标签包装到每个单词,同时保留现有 HTML

jquery - 可以在 asp.net mvc4 中使用 jquery 在 @html.label 中设置值吗?

javascript - 如何将 iframe 内的页面重定向到另一个页面,但我们必须留在 iframe 中

html - iframe-thankyoupage

html - 将联系页面链接到 HTML5 中的主页

html - 更多 HTML/CSS [min-]height 问题

css - 边框图像如何与线性渐变一起使用?

JavaFX - 将 css 文件添加到 Maven 元素

没有 ID 的 Jquery 悬停

jquery - 我应该使用 iframe 而不是 ajax 吗?