Home > Web Front-end > CSS Tutorial > What is the difference between display:none and visibility:hidden

What is the difference between display:none and visibility:hidden

hzc
Release: 2020-06-28 10:52:30
Original
5620 people have browsed it

The difference between [display:none] and [visibility:hidden] is: 1. The former does not reserve its physical space for hidden objects, while the latter reserves its physical space for hidden objects; 2. The former The structure will not be loaded until the value becomes block, which will already load it when the page is loaded.

What is the difference between display:none and visibility:hidden

##display:none Do not reserve physical space for hidden objects

##visibility :hidden

Reserves its physical space for the hidden object, that is, display:;When its value becomes

block

, where it is located The structure will be loaded. And

visibility

will be loaded in when the page is loaded, because when its value is hidden, the space it occupies is still exist. After using the CSS

display:none

attribute, the width, height and other attribute values ​​​​of the HTML element (object) will be "lost"; and the visibility: After the hidden attribute, the HTML element (object) is only visually invisible (completely transparent), and the space it occupies still exists

Recommended tutorial: "

css tutorial

The above is the detailed content of What is the difference between display:none and visibility:hidden. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template