如何使DIV浮动在另一个DIV的顶部,而不按下CSS下面 [英] How to make a DIV float on top of another DIV without pushing down the CSS Underneath

查看:344
本文介绍了如何使DIV浮动在另一个DIV的顶部,而不按下CSS下面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请查看以下示例:



http ://jsfiddle.net/MVfVD/



我想将overlayedFrameFooterdiv设置为框架的TOP,而不使用

解决方案

任何想法?

> 现场演示




  • 我添加了位置:相对 #frame 。 >
  • 我添加了 width:100%;
  • 我更改了的位置: c>
  • $


查看此处解释为什么这样工作。


Please take a look at the following example:

http://jsfiddle.net/MVfVD/

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?

解决方案

Live Demo

  • I added position:relative to #frame.
  • I added width:100%; text-align:center to #overlayedFrameFooter.
  • I changed position:relative to position:absolute on #overlayedFrameFooter.

See here for an explanation of why this works.

这篇关于如何使DIV浮动在另一个DIV的顶部,而不按下CSS下面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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