Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the way for div css to hide content styles?

Shulou Source: shulou.com Published: 2022-06-02 00:02:13 11月15日 Update

This article introduces the knowledge of "what is the method of hiding content style in div css". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

In general, the purpose of css hiding is as follows:

1. Hiding the text

2. Hide hyperlinks (alternative black chains)

3. Code hiding for statistics

4. Hide beyond the picture

5. Css hides the scroll bar

6. Css hides the div layer

1. Using css hiding method to use CSS style words and their corresponding interpretations

1. Use display:none; to hide all information (no white space occupancy)

2. Use overflow:hidden; to hide spilled text or pictures

3. Use overflow-y:hidden; and overflow-x:hidden to control whether the scroll bar is hidden or not

Second, common div css hiding cases

1. Css hides DIV and content, and completely hides content and layout

Explanation: use the CSS word display:none; to completely hide text and pictures

You can't see me.

Using the css style display:none; in div will make the content hidden in div invisible through the browser, and the hidden content will not take up space, which is usually used to hide JS special effects and hide statistical code display icons.

Extended reading:

1) set the indentation style (text-indent:-9999px) method through the object box to hide the hyperlink text content

2) hide the text above the picture

Go ahead and learn more: css hides div html content

2. Overflow: hidden hides overflowed DIV content or images

Example codes are as follows:

I can see. You can't see me. I can see it, too.

Hide the screenshot of the overflow content

Use the css style by setting a fixed height and width to the "you can't see me" div css layer, and then using the overflow: hidden style to hide content beyond the fixed height and width without occupying the hidden location.

3. Css hides the scroll bar

Use overflow-y:hidden; and overflow-x:hidden to hide or show scroll bars that correspond to horizontal or vertical directions. This case can be entered into the overflow-y of the css manual and the overflow-x of the css online manual with detailed instructions on how to hide or show the setting of the scroll bar.

This is the end of the content of "what is the method of hiding content style in div css". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Content style method picture code text word situation manual text more case knowledge link statistics explanation practicality achievement next location Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Apple Huawei MariaDB Docker