我试图让两个div(一个嵌入YouTube视频坐在图像上,另一个是文本)并排坐在一起。我通常会使用float: left;
规则来做到这一点,但是通过图像上的视频的CSS/HTML组合来处理更为棘手。写在旁边
我该如何去做这件事?
我的代码:你的页面上
.backgroundimage {
position: relative;
top: 70px;
right: 390px;
float: left;
}
.Youtube {
position: absolute;
left: 280px;
bottom: 46px;
}
<div class="backgroundimage">
<img src="http://truespeed.ca/wp-content/uploads/2016/06/tvscreen.png" alt="null" />
<iframe class="Youtube" width="479" height="269" src="https://www.youtube.com/embed/6ydYvG52K-E" frameborder="0" allowfullscreen></iframe>
<p>Hi, this is some test text!</p>
</div>
我没有看到你的HTML代码中的任何文本。 –
我给它增加了一些文字。谢谢你告诉我! –
请检查我发布的答案中的代码。 –