CSS - position absolute&文档流 [英] CSS - position absolute & document flow

查看:162
本文介绍了CSS - position absolute&文档流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是的,我知道不工作的位置绝对,但有一种方法来显示不在他们后面的下面的元素(在代码后)?



示例:

 < img src =image.jpgstyle =width:500px; height:400px; position:absolute ; top:0; /> 
< h2 style =padding:15px>此文字不在图片下方< / h2>

是否有一种显示



示例:



http://jsfiddle.net/fDGHU/1/



(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:

http://jsfiddle.net/fDGHU/1/

(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&amp;文档流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆