最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

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

matteradmin8PV0评论

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?

Post a comment

comment list (0)

  1. No comments so far