CSS - position absolute&文档流 [英] CSS - position absolute & document flow
问题描述
是的,我知道不工作的位置绝对,但有一种方法来显示不在他们后面的下面的元素(在代码后)?
示例:
< img src =image.jpgstyle =width:500px; height:400px; position:absolute ; top:0; />
< h2 style =padding:15px>此文字不在图片下方< / h2>
是否有一种显示
示例:
(yes, 在 中使用绝对和 h2_lin>解决方案
我能够做你所要求的唯一方法是设置 h2的
,又称图像后面的文本。 小提琴 top
PS: position:block
不存在。只有绝对
,相对
, static
$ c> fixed 。
Yes, I know doesn't work with position absolute, but is there a way to display elements "below" (after in code) not behind them?
Example:
<img src="image.jpg" style="width: 500px; height: 400px; position: absolute; top: 0;" />
<h2 style="padding: 15px" >This text is behind not below the image</h2>
Is there a way of displaying the h2 below the image excepting positioning it absolutely too?
Example:
(yes, I have to use absolute in my case, and dynamic margined content below, and I'm lost :D)
The only way I was able to do what you are asking is setting the top
property of h2
, aka positioning the text after the image. Fiddle.
PS: position:block
doesn't exist. Only absolute
, relative
, static
, and fixed
.
这篇关于CSS - position absolute&文档流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!