当前位置:网站首页>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)
边栏推荐
猜你喜欢

Phospholipid-polyethylene glycol-targeted neovascularization targeting peptide APRPG, DSPE-PEG-APRPG

云服务器安装部署Nacos2.0.4版本

String comparison size in MySQL (date string comparison problem)

如何查看一个现有的keil工程之前由什么版本的keil IDE编译

canvas--pie chart

Living to detect the Adaptive Normalized Representation Learning for GeneralizableFace Anti - Spoofing reading notes

C语言入门小游戏—三子棋

querystring模块

我的小笔记 =》其他东东

【装机】老毛桃的安装及使用
随机推荐
由中序遍历和前序遍历得到后序遍历(树的遍历)
啃瓜记录又一天
由中序遍历和后序遍历得到前序遍历(树的遍历)
basic operator
微信小程序云开发-证件照的实现
微信小程序怎么批量生成带参数的小程序码?
C语言中关于2的n次方求值问题(移位运算)
FreeRTOS内核详解(1) —— 临界段保护原理
yolov5调用ip摄像头时出现的问题
区间问题 : 今年暑假不AC
我的小笔记 =》其他东东
DOM manipulation---magnifying glass case
简单黑马头条项目
parser = argparse.ArgumentParser()解析
AttributeError: 'Upsample' object has no attribute 'recompute_scale_factor'
利用 nucleo stm32 f767zi 进行USART+DMA+PWM输入模式 CUBE配置
PCL—point cloud data segmentation
String comparison size in MySQL (date string comparison problem)
The difference between the knowledge question and answer session with the knowledge
DSPE-PEG-Silane, DSPE-PEG-SIL, phospholipid-polyethylene glycol-silane modified active group