What is the difference between a div floating layer and a div layer in CSS?
First, the Div floating layer and div layer are the div layout, the body sense music generally uses the CSS style sheet and the div tag combination to layout the webpage.
div layer generally includes div floating layer, div floating layer Description div is added CSS floating style so called Div floating layer, and not joined float floating style does not have floating effect, so if not added floating style div is not called floating layer. Of course, span, H1, UL, Li and other labels are also layers, but span, H1, UL, Li and other tags do not have a high frequency div, so generally will be the div as a symbolic salutation.
Next DIVCSS5 through an example to tell you what is the general layer, what is a floating layer? Why use a div CSS floating layer.
1, complete DIV+CSS instance HTML code as follows body sense Music relaxation chair
<! DOCTYPE html>
<meta charset= "Utf-8"/>
<title>div layer and floating layer </title>
<style>
. divcss5{width:400px; height:100px}
. divcss5-a{Float:left; border:1px solid #F00; width:100px; height:80px}
. divcss5-b{float:right; border:1px solid #00F; width:100px; height:80px}
</style> Body Music Relaxation chair
<body>
<div class= "DIVCSS5" >
<div class= "Divcss5-a" ></div>
<div class= "Divcss5-b" ></div>
</div>
</body>
The object ". Divcss5" is not set to float, ". Divcss5-a" is set to float on the left (Float:left), ". Divcss5-b" is set to float on the right (Float:right).
2. Example of normal layer and floating layer
Common layer and floating layer CSS case
Common layer and floating layer CSS case
3. Layer and floating layer summary body sense Music relaxation chair
In the above example, the ". Divcss5" object is a normal layer, and the default is a layer that does not have a floating effect, because the content of the page is left, so to see this layer left, there is actually no floating style of a div box layer. The ". Divcss5-a" and ". Divcss5-b" of the object are set to float so that they become floating layers, which can be seen in the ". Divcss5" box. A floating one on the left floats on the right. The difference between a normal layer and a floating layer is whether the CSS float style is set.
4. Why floating styles are set
This is because you want the div object box to be left-or-right-layout.