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

How to set div suspension in html

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to set div suspension in html related knowledge, detailed and easy to understand, simple and fast operation, has a certain reference value, I believe everyone read this html how to set div suspension articles will have some gains, let's take a look at it.

1. So first of all, we have to create a new.html file, in the file we insert two div tags convenient, etc. Let's compare and see how floating method! Then the next is our code part, in each div tag to join our class selector, there is no understanding of the small partners can be in the CSS selector to learn and review oh! The code is as follows:

Suspension settings .float_box_seting { width: 500px; height: 150px; background-color: antiquewhite; } div p { text-align: center; } .float_box_discover { background-color: aqua; width: 150px; }

Clear and flat tone·one

Li Bai [Tang Dynasty]

Clouds want clothes, flowers want to accommodate, spring breeze threshold dew thick.

If you don't see the first group of jade mountains, you will meet under the moon at Yaotai.

Display the position of the floating box

In the code block, we use an inline CSS style, there is no clear knowledge about the style of friends, you can introduce CSS common methods and parsing in HTML for a review and understanding Oh!

2. After completing the above creation steps, we also saw an effect map, so how to set the float, then this step can see the effect! We add a position element according to the code provided above. In this element, we add an absolute to set the position of the floating box. For those who do not understand absolute positioning and relative positioning, they can learn and understand in the positioning usage analysis description. Oh, the code is as follows:

.float_box_discover { background-color: aqua; width: 150px; text-align: center; position: absolute; top: 55px; left: 55px; }

We can see from this CSS code that we set the top margin and left margin of the box after using the position element.

About "html how to set div suspension" the content of this article is introduced here, thank you for reading! I believe everyone has a certain understanding of "how to set div suspension in html" knowledge. If you still 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