我有一个IMG和IFRAME,并希望它们并排显示



这就是我所拥有的,不知道为什么它没有并排显示。我尝试使用浮点左,并尝试使用引导网格但没有成功。谢谢。

<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>

我只是用这个.它有效。

    .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>

相关内容

最新更新