Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to realize the hiding effect in css

Shulou Source: shulou.com Published: 2022-05-31 13:12:14 10月03日 Update

This article mainly introduces the relevant knowledge of "how to achieve hidden effect in css". The editor shows you the operation process through an actual case. The operation method is simple and fast, and it is practical. I hope this article "how to achieve hidden effect in css" can help you solve the problem.

1.opacity:0 only hides the elements, but still occupies the layout, so it still has an impact on the layout.

Snda:opacity:0 only hides the elements, but still occupies the layout, so it still has an impact on the layout.

Ppskdkad

.div1 {opacity: 0position widthposition 200px solid red; solid red;}

2.visibility:hidden still hides the elements, but still occupies the layout

Is this the second div visibility:hidden or is it just hiding the elements, but still occupying the layout?

Look at the effect.

.div2 {visibility: hidden;width:200px;height:200px;border:1px solid red;}

3.display:none does not affect the layout

This is the third DIV display:none that will not affect the layout.

If you don't believe it, look.

.div3 {display: none;width:200px;height:200px;border:1px solid red;}

4.position:absolute does not affect the layout

This is the fourth div. I don't think it will affect the layout, but will we take a look at it or not? sure enough, this will not affect the layout.

Take a look

V.div4 {position: absolute;top:-9999px;left:-9999px;width:200px;height:200px;border:1px solid red;} on "how to achieve hidden effects in css" content is introduced here, thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

Tags: Layout or influence effect element just knowledge industry this is different practical three content practical practical articles methods more cases see Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS OPPO Reno Microsoft Linux Shulou Tech Info