gpt4 book ai didi

css - 我如何在 twitter bootstrap 3 中将 Youtube 视频 (iframe) 居中?

转载 作者:技术小花猫 更新时间:2023-10-29 11:13:43 24 4
gpt4 key购买 nike

您好,我正在尝试将 Twitter Boostrap 3 中的 Youtube 视频的 iframe 居中,目前它是左对齐的。

我使用了以下 html:

      <div class="embed-responsive embed-responsive-16by9">

<iframe class="embed-responsive-item"
src="http://www.youtube.com/embed/zpOULjyy-n8?rel=0"
align="center" id="videothumbnail"></iframe>

</div>

CSS:

    #videothumbnail{
height: 50%;
width: 50%;
float: center;}

最佳答案

使用类 col-xs-12 text-center。你不需要 float:center;

所以改变这个:

<div class="embed-responsive embed-responsive-16by9">

<div class="embed-responsive embed-responsive-16by9 col-xs-12 text-center">

关于css - 我如何在 twitter bootstrap 3 中将 Youtube 视频 (iframe) 居中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25560954/

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