当前位置:网站首页>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)
边栏推荐
- 【手把手带你学nRF52832/nRF52840 · (1)开发环境搭建】
- 微信小程序云开发之模糊搜索
- 新工程加载YOLOV6的预训练权重问题
- UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the index ing argu
- 网址URL
- 【面试】失败的一次面试
- C语言 void和void *(无类型指针)
- 骨架效果 之高级渐变,适用图片等待时
- C语言入门小游戏—三子棋
- DSPE-PEG-Silane, DSPE-PEG-SIL, phospholipid-polyethylene glycol-silane modified active group
猜你喜欢
随机推荐
The querystring module
函数提升和变量提升
__dirname
啃瓜记录第一天
云服务器安装部署Nacos2.0.4版本
__dirname
Basic usage of Monaco Editor
语义分割标签即像素值的巨坑,transforms.ToTensor()的错误使用
钟表刻度线
解决MySQL创建子视图并查看的时候,字符集报错问题
Circular linked list---------Joseph problem
C语言入门小游戏—三子棋
枚举法方法:(leetcode1300)转变数组后最接近目标值的数组和
AttributeError: 'Upsample' object has no attribute 'recompute_scale_factor'
String comparison size in MySQL (date string comparison problem)
DOM manipulation---magnifying glass case
SSM整合
The usage of json type field in mysql
针对简历上的问题
require模块化语法