gpt4 book ai didi

html - 我的 iFrame 如何在 2 或 3 列中显示?

转载 作者:行者123 更新时间:2023-11-28 01:51:26 26 4
gpt4 key购买 nike

下面的代码很难看,你能帮我把它放到列中吗?2 或 3,以便我可以全屏查看帧。

<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>

<br><br>
<p><input type="button" onclick="two.location.href='http://goole.com/';document.getElementById('two').frameBorder=1" value="T">
<input type="button" onclick="two.location.href='http://yahoo.com/';document.getElementById('two').frameBorder=1" value="U">
<br><iframe src="https://cdn.dribbble.com/users/3506/screenshots/937913/gameover.png" name="two" id="two" marginwidth="10" marginheight="" width="300" height="300"sandbox="allow-forms allow-pointer-lock allow-scripts allow-top-navigation"> </iframe></p>

<p><input type="button" onclick="one.location.href='http://bing.com/';document.getElementById('one').frameBorder=1" value="T">
<input type="button" onclick="one.location.href='http://zazzle.com/';document.getElementById('one').frameBorder=1" value="U">
<br><iframe src="https://cdn.dribbble.com/users/3506/screenshots/937913/gameover.png" name="one" id="one" marginwidth="10" marginheight="" width="300" height="300"sandbox="allow-forms allow-pointer-lock allow-scripts allow-top-navigation"> </iframe></p>

<p><input type="button" onclick="three.location.href='bing.com/';document.getElementById('three').frameBorder=1" value="T">
<input type="button" onclick="three.location.href='http://jeeves.com/';document.getElementById('three').frameBorder=1" value="U">
<br><iframe src="https://cdn.dribbble.com/users/3506/screenshots/937913/gameover.png" name="three" id="three" marginwidth="10" marginheight="" width="300" height="300"sandbox="allow-forms allow-pointer-lock allow-scripts allow-top-navigation"> </iframe></p>

<p><input type="button" onclick="four.location.href='bing.com/';document.getElementById('four').frameBorder=1" value="T">
<input type="button" onclick="four.location.href='http://jeeves.com/';document.getElementById('four').frameBorder=1" value="U">
<br><iframe src="https://cdn.dribbble.com/users/3506/screenshots/937913/gameover.png" name="four" id="four" marginwidth="10" marginheight="" width="300" height="300"sandbox="allow-forms allow-pointer-lock allow-scripts allow-top-navigation"> </iframe></p>

</body>
</html>

最佳答案

你可以使用下面的代码为 3 列

HTML:

<body>
<div class="row">
<div class="col-md-4">
<input type="button" onclick="two.location.href='http://goole.com/';document.getElementById('two').frameBorder=1" value="T" />
<input type="button" onclick="two.location.href='http://yahoo.com/';document.getElementById('two').frameBorder=1" value="U" />
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="https://www.youtube.com/embed/zpOULjyy-n8?rel=0" allowfullscreen></iframe>
</div>
</div>
<div class="col-md-4">
<input type="button" onclick="two.location.href='http://goole.com/';document.getElementById('two').frameBorder=1" value="T" />
<input type="button" onclick="two.location.href='http://yahoo.com/';document.getElementById('two').frameBorder=1" value="U" />
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="https://www.youtube.com/embed/zpOULjyy-n8?rel=0" allowfullscreen></iframe>
</div>
</div>
<div class="col-md-4">
<input type="button" onclick="two.location.href='http://goole.com/';document.getElementById('two').frameBorder=1" value="T" />
<input type="button" onclick="two.location.href='http://yahoo.com/';document.getElementById('two').frameBorder=1" value="U" />
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="https://www.youtube.com/embed/zpOULjyy-n8?rel=0" allowfullscreen></iframe>
</div>
</div>
</div>
</body>

CSS:

body {
margin: 0;
}

.row {
display: flex;
flex-wrap: wrap;
}

.embed-responsive {
position: relative;
display: block;
width: 100%;
padding: 0;
overflow: hidden;
}

.embed-responsive::before {
display: block;
content: "";
}

.embed-responsive-16by9::before {
padding-top: 56.25%;
}

.embed-responsive .embed-responsive-item {
position: absolute;
top: 0;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
border: 0;
}

.col-md-4 {
width: 100%;
padding: 15px;
box-sizing: border-box;
}

@media(min-width: 768px) {
.col-md-4 {
max-width: 33.33333%;
flex: 0 0 33.33333%;
}
}

关于html - 我的 iFrame 如何在 2 或 3 列中显示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49904103/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com