当前位置:网站首页>元素的层级
元素的层级
2022-07-27 12:48:00 【不好意思,此人不存在】
元素的层级
<!DOCTYPE html>
<html lang="ch">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style> body{
font-size: 50px; } .box1{
width: 200px; height: 200px; background-color: #bbffaa; position: absolute; /* 在开启了定位元素,可以通过z-index属性来指定元素的层次 z-index需要一个整数作为参数,值越大元素的层级越高 元素的层次越高月优先显示 如果元素的层级一样,则优先显示靠下的元素 祖先元素的层级再高也不会盖住后代元素 */ /* z-index: 1; */ } .box2{
width: 200px; height: 200px; background-color: rgba(255, 0, 0, .3); position: absolute; top: 50px; left: 50px; /* z-index: 2; */ } .box3{
width: 200px; height: 200px; background-color: yellow; position: absolute; top: 100px; left: 100px; /* z-index: 3; */ } .box4{
width: 100px; height: 100px; background-color: orange; position: absolute; } </style>
</head>
<body>
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3
<div class="box4"></div>
</div>
</body>
</html>
-运行一下就知道原理
边栏推荐
- Poj1273 drainage ditches [maximum flow] [SAP]
- PySide6/PyQt开发经验总结(2) - 设置快捷键
- Vi. analysis of makefile.build
- POJ2446 Chessboard【二分图最大匹配】
- How can the top 500 enterprises improve their R & D efficiency? Let's see what industry experts say!
- 最新版泛域名证书申请
- AMD Adrenalin 22.7.1 驱动更新:OpenGL 性能翻倍,支持微软 Win11 22H2 系统
- Do you really understand CMS garbage collector?
- 详述try-catch-finally
- 592. Fraction addition and subtraction: introduction to expression calculation
猜你喜欢

How can the top 500 enterprises improve their R & D efficiency? Let's see what industry experts say!

Dominoes staged: the beginning and end of the three arrow capital crash
QT | qcheckbox of control

ArrayList常用方法总结

视频游戏沉迷行为研究综述

Laboratory procedures and references of chloramphenicol acetate

Vi. analysis of makefile.build

Aike AI frontier promotion (7.27)

Summary of common methods of ArrayList

C program debugging and exception handling (try catch)
随机推荐
js日期时间格式化(年月日、时分秒、星期、季度、获取时间差、日期与时间戳转换的功能)
开源项目丨Taier1.2版本发布,新增工作流、租户绑定简化等多项功能
Gartner 权威预测未来4年网络安全的8大发展趋势
How can the top 500 enterprises improve their R & D efficiency? Let's see what industry experts say!
「游戏引擎 浅入浅出」4.1 Unity Shader和OpenGL Shader
Detail try catch finally
How to ask questions on the road for the first time - necessary skills for self-study (with live playback)
Cvpr22 | graph neural architecture search of relational consciousness
内涵语录
Uniapp video video playback is not completed. It is forbidden to drag the progress bar fast forward
PG synchronizes multiple data tables to MySQL. Is there a way to simplify the configuration?
"Game engine light in light out" 4.1 unity shader and OpenGL shader
feign client三个客户端的自动装配
湖仓一体电商项目背景与架构介绍及基础环境准备
ArrayList常用方法总结
Minimally invasive brain science broke the listing: the company's market value is HK $14.3 billion, and minimally invasive medical is the major shareholder
Mixin\ plug in \scoped style
MySQL扩展
592. Fraction addition and subtraction: introduction to expression calculation
Regular expressions remove spaces at both ends