What are the properties used for hiding in CSS

青灯夜游
Release: 2022-05-18 17:59:05
Original
3490 people have browsed it

Three attributes used for hiding: 1. visibility, when the attribute value is "hidden", the hidden element itself can occupy the position; 2. display, when the value is "none", it does not occupy the position Hide the element itself; 3. overflow, when the value is "hidden", the content beyond the box can be hidden.

What are the properties used for hiding in CSS

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

Attributes and values used for hiding in CSS

  • visibility:hiddenHidden elements itself, and occupies a position in the web page

  • display:noneHides the element itself, and occupies no position in the web page (commonly used)

  • overflow:hiddenHide the content beyond the box (the content beyond the box is hidden but does not occupy space)

Example 1: display: none does not occupy the position, hides

      隐藏元素  

box1

display: none;

普通
Copy after login

What are the properties used for hiding in CSS

Example 2: visibility: hidden, occupies the position, hides

      隐藏元素  

box2

visibility: hidden;

普通
Copy after login

What are the properties used for hiding in CSS

Example 3: overflow:hidden hides the content beyond the box

      隐藏元素  

box3

内容超出了

我敲多行~

我敲多行~

我敲多行~

我敲多行~

我敲多行~

我敲多行~

我敲多行~

我敲多行~

我敲多行~

我敲多行~

我敲多行~

我敲多行~

我敲多行~

我敲多行~

box4

overflow: hidden;
内容超出,超出部分隐藏

我敲多行~

我敲多行~

我敲多行~

我敲多行~

我敲多行~

我敲多行~

我敲多行~

我敲多行~

我敲多行~

我敲多行~

我敲多行~

我敲多行~

我敲多行~

我敲多行~

Copy after login

What are the properties used for hiding in CSS

(Learning video sharing:css video Tutorial,web front-end)

The above is the detailed content of What are the properties used for hiding in CSS. 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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!