1、z-index属性值:当默认值为0时,z-index属性可以设置各元素之间的重叠关系。
2、z-index值大的层位于其值小的层之上。
实例
div { position: relative; width: 100px; height: 100px; } p { position: absolute; font-size: 20px; width: 100px; height: 100px; } .a { background-color: pink; z-index: 1; } .c { background-color: green; z-index: 2; top: 20px; left: 20px; } .b { background-color: red; z-index: 3; top: -20px; left: 40px; }
以上就是css overflow属性的作用,希望对大家有所帮助。更多css学习指路:
本文教程操作环境:windows7系统、css3版,DELL G3电脑。
Copyright © 2019- net188.cn 版权所有 湘ICP备2022005869号-2
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务