Files
StudyDiary/20-我的收藏夹/21-浏览器收藏/开源项目/OnlyOffice/纯css实现iframe高度自适应_css iframe 高度_永远的WEB小白的博客-CSDN博客.md
CrazyJasonwell fb40c9b109 add all
2025-10-25 20:35:10 +08:00

17 lines
980 B
Markdown
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
raindrop_id: 670473047
created: 2025-08-30T11:44
updated: 2025-09-22T13:26
---
# Metadata
Source URL:: https://blog.csdn.net/qq_39339179/article/details/118576443
---
# 纯css实现iframe高度自适应_css iframe 高度_永远的WEB小白的博客-CSDN博客
文章浏览阅读2.7k次。当我们转载文章或者发布文章时经常会需要用iframe标签引入视频或者网页,但是用iframe标签引入视频最大的一个问题就是无法自适应高度,宽度不是什么大问题,只有我们在iframe标签中加入width="100%"就可以啦,但是高度写100%是不生效的只能写死,但是这就造成了iframe高度无法自适应,比如在电脑上能正常显示,手机上就无法正常显示,哪么有什么办法可以设置iframe高度自适应呢?其实很简单,并不用像网上说的那样,用js去监听浏览器高度纯css就可以实现iframe高度自适应纯css实现i_css iframe 高度
## Highlights