How to implement non-display elements in css: You can use the display and visibility attributes, such as [display:none;visibility:hidden;]. The display attribute specifies the type of box the element should generate, and the visibility attribute specifies whether the element is visible.
The display and visibility attributes in css can be used to hide and show html elements.
(Learning video sharing: css video tutorial)
display attribute:
The display attribute specifies the type of box that the element should generate.
Attribute value:
none This element will not be displayed.
block This element will be displayed as a block-level element, with line breaks before and after this element.
#inline Default. This element will be displayed as an inline element with no line breaks before or after the element.
#inline-block Inline block element. (New value in CSS2.1)
list-item This element will be displayed as a list.
visibility attribute:
The visibility attribute specifies whether the element is visible.
visible Default value. The element is visible.
hidden The element is invisible.
collapse When used in a table element, this value deletes a row or column, but it does not affect the layout of the table. The space occupied by a row or column is freed for other content. If this value is used on another element, it will be rendered as "hidden".
#inherit Specifies that the value of the visibility attribute should be inherited from the parent element.
Code example:
Achievement effect:
After hiding the second row, it still occupies the original position. After hiding the fourth row, it does not occupy the original position.
Related recommendations: CSS tutorial
The above is the detailed content of How to avoid displaying elements in css. For more information, please follow other related articles on the PHP Chinese website!

In this week's roundup: Firefox gains locksmith-like powers, Samsung's Galaxy Store starts supporting Progressive Web Apps, CSS Subgrid is shipping in Firefox

In this week's roundup: Internet Explorer finds its way into Edge, Google Search Console touts a new speed report, and Firefox gives Facebook's notification

You’re probably already at least a little familiar with CSS variables. If not, here’s a two-second overview: they are really called custom properties, you set

Building websites is programming. Writing HTML and CSS is programming. I am a programmer, and if you're here, reading CSS-Tricks, chances are you're a

Here's what I'd like you to know upfront: this is a hard problem. If you've landed here because you're hoping to be pointed at a tool you can run that tells

Picture-in-Picture made its first appearance on the web in the Safari browser with the release of macOS Sierra in 2016. It made it possible for a user to pop

Gatsby does a great job processing and handling images. For example, it helps you save time with image optimization because you don’t have to manually

I learned something about percentage-based (%) padding today that I had totally wrong in my head! I always thought that percentage padding was based on the


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft