在图像上显示iframe?(Displaying Iframe on top of image?)

编程入门 行业动态 更新时间:2024-10-14 16:23:29
图像上显示iframe?(Displaying Iframe on top of image?)

问题

我想在图像中显示iframe,但不知道如何做到这一点。 有没有比用CSS定位更好的方法?

我有一个显示其他网站的html页面,我想在该页面下面的图像屏幕中显示一个iframe。

Problem

I want to display an iframe within an image, but have no idea how to do this. Is there a better way than purely positioning with css?

I have a html page that displays other websites, and I would like to display an iframe within the screen of the image below on that page.

最满意答案

我将屏幕设为背景图像,然后使用绝对定位的iframe。 我在演示中向屏幕添加了一个YouTube iframe。

演示

.outer { background-image: url('http://i.stack.imgur.com/6hnLq.png'); width:420px; height:365px; } .inner { position: relative; background-color:; left: 67px; top: 109px; width:277px; height:150px; }

............

<div class="outer"><iframe class="inner"></iframe>

您甚至可以使用2或3px边框半径来匹配图像。

I made the screen a background image and then used a absolute positioned iframe. i added a YouTube iframe to the screen in the demo.

Demo

.outer { background-image: url('http://i.stack.imgur.com/6hnLq.png'); width:420px; height:365px; } .inner { position: relative; background-color:; left: 67px; top: 109px; width:277px; height:150px; }

............

<div class="outer"><iframe class="inner"></iframe>

you could even use a 2 or 3px border-radius to match the image.

更多推荐

本文发布于:2023-08-01 02:06:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1350628.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:图像   iframe   Displaying   image   top

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!