如何让iframe,object,embed标签完美自适应视频宽度高度?下面青岛网站建设的小编就给出对应的css控制代码。
.video {
position: relative;
padding-bottom: 56.25%;
height: 0;
overflow: hidden;
}
.video iframe,
.video object,
.video embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}html代码
<p class="video"> <iframe src="https://www.xxx.com" frameborder="0" allowfullscreen="allowfullscreen"></iframe> </p>
这样视频嵌入已经实现了宽高自适应了。
我是有底线的
扫描二维码手机查看该文章
文章引用:https://www.qinghuahulian.com/news/webzhishi/1432.html




