Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the way to locate in CSS?

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

Today, the editor will share with you the relevant knowledge about the positioning of CSS. The content is detailed and the logic is clear. I believe most people still know too much about this, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.

1. In the case of static positioning, each element is in a regular document stream. They are all block elements, so they are stacked on the page from top to bottom.

Position: static

2. Relative positioning relative to the original location (or default location) in the document stream

The space in the original location of the element remains unoccupied, the element moves to another location on the page, and the element responds to the event in the new location.

Position: relative

3. Under absolute positioning, the element is "uprooted" from the document stream and then positioned relative to other elements (in this case, the default positioning context body).

Position: absolute

4. the positioning context of the fixed positioning element is the viewport (the browser window or the screen of the handheld device), so it does not move as the page scrolls. Fixed positioning is suitable for floating label effect, and the page is always suspended in a specific position when scrolling.

Position: three ways of introducing fixed;css 1. Inline style, the most straightforward and simplest, uses style= "" directly for HTML tags. two。 The embedded style is to write the CSS code in between and use the

To make a statement. 3. External style, in which the link style is the most frequently used and the most practical style, only need to add

Just do it. The second is to import styles, import styles and link styles are similar, using @ import style to import CSS stylesheets, not recommended. These are all the contents of the article "what is the way to position in CSS?" Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report