最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

html - How can I make an iframe's contents match the behavior of css's object-fit:contain? - Stack Overflow

programmeradmin0浏览0评论

I am trying to embed an iframe containing a data visualization. I want the full contents of the graph to be visible on all device sizes (most of the utility comes from seeing the whole visualization). This would match the css property object-fit: contain. For example the intended behavior can be seen here under the Try it heading.

What I am getting now is more like object-fit:fill with a scrollbar. I have tried adjusting the height and width of the iframe to be responsive, but that isnt affecting how the content inside is set within the iframe. How can I make the content scale to be fully fit within the iframe or a parent element so that the full visualization is visible independent of the screen size?

发布评论

评论列表(0)

  1. 暂无评论