gpt4 book ai didi

css - 无法将嵌入视频保存在响应式背景框中

转载 作者:行者123 更新时间:2023-11-28 08:28:18 25 4
gpt4 key购买 nike

我已经尝试了多种解决方案来解决我的问题,但我猜想我的元素设计的独特结构需要独特的解决方案才能将视频装入盒子并保持响应。这是我想要实现的目标的快照: mock up image

image preview

现在这是我的代码链接: http://new.loversorlosers.com看到我要放置响应式视频的黑框。

到目前为止,我已经尝试了 SO 和其他教程网站上可用的不同示例,但没有一个有效。我猜这是由于视频嵌入的独特位置而发生的。

目前我正在尝试这种 jQuery 方法,但即使这样也不适用于不同的屏幕尺寸:StackOverflow example position of element over background

我正在使用 bootstrap 3 和 bootswatch 框架。

谢谢你的帮助

最佳答案

我找到了这个 YouTube 视频,它可以引导您完成这些步骤。创建一个文件夹,下载 bootstrap,将文件解压缩到新文件夹中粘贴以下代码 https://www.youtube.com/watch?v=oAPdNKTrBYA

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Template</title>

<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<style>
h1 {
color: red;
}

h2 {
color: black;
}

h3 {
color: red;
}

</style>
</head>
<body>
<div class="row">
<div class="col-md-6">
<div class="navbar-wrapper">
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Brand</a>
</div>

<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
<li><a href="#">Link</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Dropdown <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li><a href="#">Separated link</a></li>
<li class="divider"></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>


</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
</div><!-- end of navbar wrapper -->

<div class="container">
<div class="col-md-5">
<div class="panel panel-primary">
<div class="panel-heading">
<p class="panel-title">Responsive video Embed 16by9</p>
</div><!-- end of panel heading -->
<div class="panel-body">
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="https://www.youtube.com/embed/-dfnKTY_dfc" allowfullscreen></iframe>

</div>

</div><!-- end of panel body -->
</div><!-- panel closes out here -->
</div>
</div><!-- container -->
</div>
<div class="col-md-6">
<h1> Attention All<br>Lovers..</h1>
<h2>Join Todd Bridges</h2>
<h3>For Lovers or Losers</h3>
<h2>the Game Show
And Receive a 3 Day, 2 Night stay
In the Entertainment Capital
of the World </h2>


<h2>The best part is it
Won't Cost you a dime!!! </h2>
<div class="btn btn-default"> Click Here Now Reserver Your Seat!!!</div>

</div>
</div>

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>

关于css - 无法将嵌入视频保存在响应式背景框中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28419796/

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