【发布时间】:2014-09-16 23:52:50
【问题描述】:
我正在使用 Bootstraps 网格系统来创建一个响应式站点,该站点在容器中显示内容,从不超过查看高度,并使用三列显示宽度,除非通过小屏幕查看,在这种情况下为 1 列。问题是,我的 youtube 嵌入没有响应。我尝试将其设置为 100%,自动,使用几个引导类,从嵌入切换到 iframe,并尝试了许多相同的想法。没有任何工作。无论宽度如何,我最终都会得到一个大约 100 像素的小静态高度。这是我的html。
<div class="row">
<div class="col-md-4"><center>
<h1>Once in a lifetime</h1>
<p>
Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth. Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum decided to leave for the far World of Grammar. The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks and devious Semikoli, but the Little Blind Text didn’t listen. She packed her seven versalia, put her initial into the belt and made herself on the way. When she reached the first hills of the Italic Mountains, she had a last view back on the skyline of her hometown Bookmarksg
</p>
</center></div>
<div class="col-md-4"><center>
<embed width="80%" height="100%" src="//www.youtube.com/embed/NOcjwN3jkZ4?autoplay=1" frameborder="0" allowfullscreen></embed>
</center></div>
<div class="col-md-4"><center>
<h1>Check it out!</h1>
<a href="http://wwww.link.xyz"><h3>http://wwww.link.xyz</h3></a>
</center></div>
</div>
这是我用来防止水平滚动的一些 css。
html, body {
max-width: 100%;
height:100%;
overflow-x: hidden;
}
请帮忙。
【问题讨论】:
-
Fitvids 仅处理宽度。请参阅 stackoverflow.com/a/26198291/1922144 以获取您问题的答案。
标签: css twitter-bootstrap youtube responsive-design embed