如何讓iframe,object,embed標簽完美自適應視頻寬度高度?下面青島網(wǎng)站建設的小編就給出對應的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>
這樣視頻嵌入已經(jīng)實現(xiàn)了寬高自適應了。
我是有底線的
掃描二維碼手機查看該文章
文章引用:http://www.qingbaosc.com/news/webzhishi/1432.html




