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 difference between div floating layer and Div layer in css

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

Share

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

Today, the editor will share with you what are the different knowledge points of div floating layer and Div layer in css, detailed content and clear logic. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.

What is the difference between div floating layer and div layer? what is the relationship in css?

First of all, both DIV floating layer and DIV layer refer to DIV layout, which generally uses the combination of CSS stylesheet and DIV tags to layout web pages.

Div layer generally includes div floating layer, div floating layer indicates that div is added to the css floating style, so it is called div floating layer, while there is no floating effect without adding float floating style, so if there is no floating style added, div is not called floating layer. Of course, span, H2, ul, li and other tags are also layers, but span, H2, ul, li and other tags are not as frequently used as div, so div is generally used as a symbolic name.

Next, DIVCSS5 uses an example to tell you what is a general layer and what is a floating layer? Why use div css floating layer.

1. The HTML code of a complete DIV+CSS instance is as follows

Div layer and floating layer. {width:400px; height:100px}.-a {float:left; border:1px solid # F00; width:100px; height:80px}.-b {float:right; border:1px solid # 00F; width:100px; height:80px}

Object "." Float is not set, ".-a" sets left float (float:left), ".-b" sets right float (float:right).

2. Screenshots of examples of ordinary layer and floating layer

Screenshot of CSS case of ordinary layer and floating layer

3. Summary of layer and floating layer

In the above example "." The object is a normal layer, and the default is a layer that does not have a floating effect, because the content of the web page is on the left, so you can see that this layer is on the left, which is actually a DIV box layer with no floating style. On the other hand, the inner children of the object ".-a" and ".-b" set the float float, so it becomes a floating layer, from which you can see that they are "." One floats to the left and one floats to the right in the box. The difference between a normal layer and a floating layer is whether the css float floating style is set.

4. Why set floating style

This is because you want the DIV object box to be laid out left or right.

These are all the contents of this article entitled "what is the difference between div floating layer and Div layer 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