编辑:这些解决方案必须具有display: inline-block;
我试图将一个iframe放在一张图片上面。但是,无论我将margin-right设置为什么,它都停留在同一个位置。约为背景图片的五分之一。
HTML
<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>
</div>
CSS
.backgroundimage {
display: inline-block;
position: relative;
top: 70px;
bottom: 46px;
}
.Youtube {
position: absolute;
left: 280px;
bottom: 46px;
right: 380px;
}
以下是我的问题截图:
(注:此文涉及it技术,翻译为“问题”)