z-index

z-index

这个东西非常简单,它有四大特性,每个特性你记住了,页面布局就不会出现找不到盒子的情况。

  • z-index 值表示谁压着谁,数值大的压盖住数值小的,
  • 只有定位了的元素,才能有z-index,也就是说,不管相对定位,绝对定位,固定定位,都可以使用z-index,而浮动元素不能使用z-index
  • z-index值没有单位,就是一个正整数,默认的z-index值为0如果大家都没有z-index值,或者z-index值一样,那么谁写在HTML后面,谁在上面压着别人,定位了元素,永远压住没有定位的元素。
  • 从父现象:父亲怂了,儿子再牛逼也没用

 

z-inde 就是改变两个 正在覆盖的图片的显示,可以让他们的显示的先后顺序进行改变,谁的z-index的值大就显示谁的,子级别的z-index不会改变父级的显示 但是父级会改变子级的

 

<head><meta charset="UTF-8"><title>Document</title><style>.lzy{width: 300px;height: 300px;background-color: black;position: absolute;z-index: 1;}.tl{width: 300px;height: 300px;background-color: yellow;position: absolute;z-index: 11;/*谁的级别大就显示谁的*/}/*子级在牛逼也不会带动父级改变*/.kimi{width: 100px;height: 100px;background-color: green;position: absolute;top: 400px;left: 400px;z-index:30000;}.sd{width: 100px;height: 100px;background-color: pink;position: absolute;top: 450px;left: 350px;z-index: 1000;}</style>
</head>
<body><div class="lzy"><div class="kimi"></div></div><div class="tl"><div class="sd"></div></div></body>

 

转载于:https://www.cnblogs.com/zhaoyunlong/p/9092222.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/390380.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

大型运输行业实战_day12_1_权限管理实现

1.业务分析 权限说的是不同的用户对同一个系统有不同访问权限,其设计的本质是:给先给用户分配好URL,然后在访问的时候判断该用户是否有当前访问的URL. 2.实现 2.1数据库设计标准5表权限结构 2.2.sql语句实现,根据用户id查询该用户所有的资源 sql语句: SELECT ur.user_id, r.u…

aws python库_如何使用Python,AWS和IEX Cloud创建自动更新股市数据的Excel电子表格

aws python库Many Python developers in the financial world are tasked with creating Excel documents for analysis by non-technical users.金融界的许多Python开发人员的任务是创建Excel文档&#xff0c;以供非技术用户进行分析。 This is actually a lot harder than i…

37)智能指针(就是自动delete空间)

1&#xff09;问题引入&#xff1a; 在java或者在C中&#xff0c;一旦你new一个东西&#xff0c;那么必然有一个delete与之对应&#xff0c;比如&#xff1a; 1 int main&#xff08;&#xff09;2 {3 int* p new int&#xff08;&#xff09;&#xff1b;4 5 *…

linux 安装maven

2019独角兽企业重金招聘Python工程师标准>>> 目录:/usr/local/maven 1.下载 wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.5.3/binaries/apache-maven-3.5.3-bin.tar.gz 2.解压 tar -zxvf apache-maven-3.5.3-bin.tar.gz 3.配置 vi /etc/profile #讲下面…

自由开发者怎么生存_如何作为自由开发者生存

自由开发者怎么生存It’s been 8 weeks since we started experiencing the dramatic impact of the COVID-19 pandemic. In that time, we’ve all borne witness to how this virus can impact our families, our communities, and our livelihood. 自我们开始体验COVID-19大…

UUID生成字符串

在向数据库插入新数据时&#xff0c;可能需要插入字符串形式的ID&#xff0c;这时使用UUID可以生成随机字符串&#xff1a; String str UUID.randomUUID().toString(); 转载于:https://www.cnblogs.com/suhfj-825/p/8260861.html

如何在React Native中使用react-navigation 5处理导航

React-navigation is the navigation library that comes to my mind when we talk about navigation in React Native. 当我们谈论React Native中的导航时&#xff0c;React-navigation是我想到的导航库。 Im a big fan of this library and its always the first solution I…

flask内置session原理

内置session原理 请求到来 当请求进来之后&#xff0c;先执行Flask对象的 __call__ 方法 def wsgi_app(self, environ, start_response):# 获取请求相关数据&#xff0c;并进行封装和加工ctx self.request_context(environ)# 将请求消息推送到堆栈中&#xff0c;并执行 open_s…

指针3

#include <stdio.h>/* 2018-05-28 如何通过被调函数修改主调函数普通变量的值1&#xff0c;实参必须为该普通变量的地址2,形参必须为指针变量3&#xff0c;在背调函数中通过*形参名 。。。。。的方式就可以修改主调函数相关变量的值*/f(int *i,int *j) {*i 4;*j 5;ret…

面试系统设计_系统设计面试问题–您应该知道的概念

面试系统设计You may have heard the terms "Architecture" or "System Design." These come up a lot during developer job interviews – especially at big tech companies.您可能已经听说过“架构”或“系统设计”这两个术语。 在开发人员工作面试中&…

8597 石子划分问题 dpdp,只考虑第一次即可

8597 石子划分问题 时间限制:500MS 内存限制:1000K提交次数:155 通过次数:53 题型: 编程题 语言: G;GCC;VC Description 给定n个石子&#xff0c;其重量分别为a1,a2,a3,...,an。 要求将其划分为m份&#xff0c;每一份的划分费用定义为这份石子中最大重量与最小重量差的平方。…

文章中嵌入代码块_如何在您的文章中嵌入多项选择测验问题

文章中嵌入代码块In my experience, supplementing study with practical exercises greatly improves my understanding of a topic. This is especially true when I can test my knowledge as I go and receive instant feedback for each question.以我的经验&#xff0c;通…

mysql免安装版配置

1.官网下载https://dev.mysql.com/downloads/mysql/ 2.将下载好的压缩包mysql-5.7.20-winx64.zip解压。 3.mysql解压后&#xff0c;设置.ini文件&#xff0c;在加压后的路径中加一个my.ini文件 配置如下内容&#xff1a; # 设置mysql客户端默认字符集 default-character-setutf…

各种IE(IE6-IE10)兼容问题一行代码搞定

x-ua-compatible 用来指定IE浏览器解析编译页面的model x-ua-compatible 头标签大小写不敏感&#xff0c;必须用在 head 中&#xff0c;必须在除 title 外的其他 meta 之前使用。 1、使用一行代码来指定浏览器使用特定的文档模式。 <meta http-equiv"x-ua-compatible&q…

802. 找到最终的安全状态

在有向图中&#xff0c;以某个节点为起始节点&#xff0c;从该点出发&#xff0c;每一步沿着图中的一条有向边行走。如果到达的节点是终点&#xff08;即它没有连出的有向边&#xff09;&#xff0c;则停止。 对于一个起始节点&#xff0c;如果从该节点出发&#xff0c;无论每…

元类型与类型的区别

元类型是指所有类型的类型。 元类型只能类型出现在类型标示位&#xff1b; 类型即能作为类型存在&#xff0c;出现在类型标示位&#xff1b; 也能作为变量存在&#xff0c;出现在元类型的变量位。 http://www.swift51.com/swift2.0/chapter3/03_Types.html#type_inheritance_cl…

css 动画使用_如何在CSS中使用动画

css 动画使用使用CSS动画 (Using CSS Animations) CSS animations add beauty to the webpages and make transitions from one CSS style to the other beautiful.CSS动画可以使网页更加美观&#xff0c;并可以从一种CSS样式过渡到另一种CSS样式。 To create a CSS animation…

第01章—快速构建

spring boot 系列学习记录&#xff1a;http://www.cnblogs.com/jinxiaohang/p/8111057.html 码云源码地址&#xff1a;https://gitee.com/jinxiaohang/springboot 一、Spring Initializr 使用教程 &#xff08;IntelliJ IDEA&#xff09; 具体步骤&#xff1a; 1、打开IDEA &am…

看板和scrum_看板VS Scrum-如何变得敏捷

看板和scrumScrum and Kanban are the two most popular project management techniques today in business. As a developer, I think its important to understand these processes as you will likely be heavily involved in them if you are part of a team. By understan…

JS之Promise

开胃菜&#xff0c;先做如下思考&#xff1a; Promise 有几种状态&#xff1f;Promise 状态之间可以转化吗&#xff1f;Promise 中的异常可以被 try...catch 捕获吗&#xff1f;Promise前世 callback hell 大家都知道JS是异步操作&#xff08;执行&#xff09;的&#xff0c;在…