CSS中如何使用z-index使一个元素与另一个元素重叠
首先,这是我所陷入困境的小提琴链接: http://jsfiddle.net/FYHMV/
我希望 box3 与 box1 重叠,并且 box3 仍然位于 box1 内,并且下面box2
box1的高度不断调整为box3的高度,而我希望将box1的高度调整为box2的内容。
希望您能在这方面帮助我,谢谢!
First, here is the fiddle link on what I am stucked in:
http://jsfiddle.net/FYHMV/
I would like box3 to overlap box1 and still have box3 inside box1 and below box2
The height of box1 keeps being adjusted to the height of box3, whereas I would like to have the height of box1 being adjusted to the content of box2.
I hope you will be able to help me on this one, thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试将框 3 更改为
position:absolute;
这是您想要做的吗?
http://jsfiddle.net/FYHMV/2/
要使您的左侧样式正常工作,您还需要将框 1 设置为
position:relative
Try changing box 3 to
position: absolute;
Is this what you are looking to do?
http://jsfiddle.net/FYHMV/2/
To get your left style to work you also need box 1 to be set to
position: relative