【问题标题】:I have an IMG and IFRAME and would like for them to display side by side我有一个 IMG 和 IFRAME,希望它们并排显示
【发布时间】:2017-04-03 15:38:27
【问题描述】:
这就是我所拥有的,不知道为什么它没有并排显示。我尝试使用左浮动,并尝试使用引导网格但没有成功。谢谢。
<div class="container">
<img src="placeholder" alt="picture of the band " width="500" height="300">
</div>
<div class="container">
<iframe width="560" height="315" src="https://www.youtube.com/embed/placeholder" frameborder="0" allowfullscreen></iframe>
</div>
【问题讨论】:
标签:
html
css
twitter-bootstrap
iframe
【解决方案1】:
我只是用这个。有用。
.container{
float: left;
}
如果您使用引导程序,请将 container 替换为任何其他类名并执行 float:left 即可。
<style>
.classname{
float: left;
}
</style>
<div class="classname">
<img src="placeholder" alt="picture of the band " width="500" height="300">
</div>
<div class="classname">
<iframe width="560" height="315" src="https://www.youtube.com/embed/placeholder" frameborder="0" allowfullscreen></iframe>
</div>