图像已经在背景图像的上面这一事实不应该改变任何东西。
有两种使用纯CSS的方法,第一种是使用绝对坐标。 例如
#img {
left: 40px;
top: 40px;
height: 80px;
width: 80px;
}
#textblock {
left: 140px;
top: 40px;
width: 200px;
}
第二个是使用相对定位。这将根据屏幕大小而改变。
#img {
left: 10%;
top: 10%;
height: 5%;
width: 5%;
}
#textblock {
left: 30%;
top: 10%;
width: 60%;
}
注意:这两个示例都假定您的文本块具有id = textblock,并且您的图像具有id = img。
注意:如果您在使用“分层”时遇到问题,请参阅“z-index”CSS属性。
编辑:使用您的更新代码并利用内联样式中的width属性,可以简单地将left属性添加到width属性以获取文本的位置, t重叠文本。
<img src="https://www.vizsy.com/public/images/brandow/Landing_Page_background.png" style="position: relative; top: 0; left: 0;"/>
<img src="http://www.psychiatry.emory.edu/images/cloud2.png" style="position: absolute; top: 30px; left: 70px; width:200px"/>
<p style="position: absolute; top: 30px; left: 270px; right:20px">some text</p>
通知段落元件左属性如何为=(IMG左)+(IMG宽度)。这意味着它将为图片旁边的段落提供一个起点,使它们不会重叠。
一些代码将是有益的....但你尝试过使用[引导](http://getbootstrap.com/)来构建一个网格,握住你的内容是什么? – matthewelsom