如何并排放置两个iframe

新手上路,请多包涵

我试过几种代码,比如这个:

 <div class="box"><iframe src="https://embed.spotify.com/?uri=spotify:user:1290230929:playlist:6nTIVNGZfnZ4urUiwHIgpT"
                         frameborder="0"
                         scrolling="no"
                         width="100%"
                         height="512"
                         align="left"> </iframe> </div>
<div class="box"><iframe src="https://embed.spotify.com/?uri=spotify:user:1285279066:playlist:56KI83cMiMTOocIdXq2R5j"
                         frameborder="0"
                         scrolling="no"
                         width="100%"
                         height="512"
                         align="right">
    </iframe>

而且它不能并排工作,如果有人可以为我解决这个问题,谢谢。

原文由 user3521680 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 836
1 个回答

这是使用 floatdivs 的解决方案

HTML:

 <div class="box">
  <iframe src="https://embed.spotify.com/?uri=spotify:user:1290230929:playlist:6nTIVNGZfnZ4urUiwHIgpT" frameborder="0" scrolling="no" width="100%" height="512" align="left"> </iframe>
</div>

<div class="box">
  <iframe src="https://embed.spotify.com/?uri=spotify:user:1285279066:playlist:56KI83cMiMTOocIdXq2R5j" frameborder="0" scrolling="no" width="100%" height="512" align="right"></iframe>
</div>

CSS:

 .box{
    float:left;
    margin-right:20px;
}
.clear{
    clear:both;
}

http://jsfiddle.net/E5WFT/

原文由 Daniel Euchar 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
logo
Stack Overflow 翻译
子站问答
访问
宣传栏