在图像下方放置文字

时间:2017-04-26 17:11:54

标签: html css

我想将文字放在图片下方。但是当我添加一个段落时,它被设置在图像后面。如何解决这个问题???

<div style="width:96%;"><img src="../Images/2.jpg" height="640" style="position: absolute; left: 0px; top: 0px; width: 1200px; height: 700px; float: left; z-index: 0;"/></div>

<div><p>Vision defines the optimal desired future state and the conceptual image of what an organization wants to achieve over time. It provides guidance and inspiration to what an organization is focused on achieving in some time. It is written briefly in an inspirational manner that makes it easy for all employees to repeat it at any given time. “All Sri Lankans seamlessly connected with world-class information, communication and entertainment services" is the vision of SLT.</p><</div>

2 个答案:

答案 0 :(得分:1)

由于DIV定位absolute
<p>代码放在DIV 内,紧跟<img>代码后。
希望它能奏效。

答案 1 :(得分:0)

您将图片放置在绝对位置,这就是为什么它位于文本上方的图层中。 只需删除样式,文本在块元素div之后垂直跟随。

body{
  margin:0;
}
<div style="width:96%;">
<img src="http://i.imgur.com/0nJG7lN.png" />
</div>

<p>Vision defines the optimal desired future state and the conceptual image of what an organization wants to achieve over time. It provides guidance and inspiration to what an organization is focused on achieving in some time. It is written briefly in an inspirational manner that makes it easy for all employees to repeat it at any given time. “All Sri Lankans seamlessly connected with world-class information, communication and entertainment services" is the vision of SLT.</p>

相关问题