扫码关注官方订阅号
父层p的样式已经设置成了overflow:hidden;不可以更改,那么我的子p如何才能超出父层p的范围显示?效果上应该像是子p漂浮于父层之上。
ringa_lee
IE6时代是可以的,以后的好像就没有办法了。毕竟是两种矛盾的需求。
position:absolute
好像没有办法吧
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN"> <head> <title>新建网页</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="description" content="#" /> <style> #fu{ width:600px; height:500px; background: gray; overflow: hidden; } #zi1{ width:300px; height: 400px; background: red; } #zi2{ width:300px; height: 400px; background: blue; position:absolute; bottom: -200px; } </style> </head> <body> <p id="fu"> <p id="zi1"></p> <p id="zi2"></p> <p id="zi3"></p> </p> </body> </html>
我试了一下position:absolute 发现应该是可以的。 楼主看一下,是你想要的效果吗?
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
扫描下载App
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
IE6时代是可以的,以后的好像就没有办法了。毕竟是两种矛盾的需求。
position:absolute
好像没有办法吧
我试了一下position:absolute 发现应该是可以的。
楼主看一下,是你想要的效果吗?