如何使DIV浮动在另一个DIV的顶部,而不按下CSS下面 [英] How to make a DIV float on top of another DIV without pushing down the CSS Underneath
本文介绍了如何使DIV浮动在另一个DIV的顶部,而不按下CSS下面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请查看以下示例:
我想将overlayedFrameFooterdiv设置为框架的TOP,而不使用
解决方案
任何想法?
> 现场演示- 我添加了
位置:相对
到#frame
。 >
- 我添加了
width:100%;
- 我更改了
$的位置:
c> - 我更改了
查看此处解释为什么这样工作。
Please take a look at the following example:
I want the "overlayedFrameFooter" div to be onTOP of the frame, in a way where it doesn't add any height to the surrounding items.
Any ideas?
解决方案
- I added
position:relative
to#frame
. - I added
width:100%; text-align:center
to#overlayedFrameFooter
. - I changed
position:relative
toposition:absolute
on#overlayedFrameFooter
.
See here for an explanation of why this works.
这篇关于如何使DIV浮动在另一个DIV的顶部,而不按下CSS下面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文