当前位置:网站首页>display,visibility,opacity
display,visibility,opacity
2022-08-02 03:40:00 【suzhiwei_boke】
The difference between display, visibility and opacity
Common point: All elements can be hidden and invisible
Difference:
display: none
(1) DOM structure: browserElements whose display attribute is none will not be rendered, and do not occupy space;
(2) Event monitoring: DOM event monitoring cannot be performed;
(3) Performance: Dynamically changing this attribute will cause rearrangement, and the performance is poor;
(4) Inheritance: will not be inherited by child elements, after all, subclasses will not be rendered;
(5) transition: transition does not support display.
visibility: hidden
(1) DOM structure: elements are hidden, but will be rendered and will not disappear, occupying space;
(2) Event monitoring: DOM event monitoring cannot be performed;
(3) Performance: Dynamically changing this property will cause redrawing, and the performance is high;
(4) Inheritance: It will be inherited by child elements, and child elements can be unhidden by setting visibility: visible;
(5) transition: transition supports visibility.
opacity: 0
(1) DOM structure: the transparency is 100%, the element is hidden, occupying space;
(2) Event monitoring: DOM event monitoring can be performed;
(3) Performance: improvedIt is a composite layer, it will not trigger redraw, and the performance is high;
(4) Inheritance: it will be inherited by child elements, and child elements cannot be unhidden by opacity: 1;
(5) transition: transitionOpacity is supported.
The bottom layer of v-show is the display attribute of the operation element
The bottom layer of v-if is the creation/destruction of the control element (create and delete dom)
边栏推荐
- 【我的创作纪念日】 3周年
- 广州华为面试总结
- Living to detect the Adaptive Normalized Representation Learning for GeneralizableFace Anti - Spoofing reading notes
- Chemical reagent Phospholipid-polyethylene glycol-hydroxyl, DSPE-PEG-OH, DSPE-PEG-Hydroxyl, MW: 5000
- 微信小程序怎么批量生成带参数的小程序码?
- 客户评分控件
- 由中序遍历和后序遍历得到前序遍历(树的遍历)
- subprocess.CalledProcessError: Command ‘pip install ‘thop‘‘ returned non-zero exit status 1.
- sh: 1: curl: not found
- 微信小程序自定义swiper轮播图面板指示点|小圆点|进度条
猜你喜欢
随机推荐
微信小程序全局组件的定义
The @autowired distinguished from @ the Resource
云服务器安装部署Nacos2.0.4版本
微信小程序云开发之券码领取,怎么防止用户领取到相同的数据?
解决glob()返回文件排序不一致问题&onnx本地按照安装方法
Source Insight 使用教程(2)——常用功能
解决MySQL创建子视图并查看的时候,字符集报错问题
Guangzhou Huawei Interview Summary
针对简历上的问题
基本运算符
Redis simple study notes
npm和package.json
DSPE-PEG-Silane, DSPE-PEG-SIL, phospholipid-polyethylene glycol-silane modified active group
npm and package.json
简单黑马头条项目
yolov5调用ip摄像头时出现的问题
Customer Rating Control
AttributeError: Can‘t get attribute ‘SPPF‘ on <module ‘models.common‘ from ‘/yolov5-5.0/models/commo
STM32 CAN过滤器
require模块化语法








