DIV floating technique



 This article can be said to be an extension of float . In CSS, float is used to declare elements to float. If you want to learn more, you can refer to this article: CSS float floating elements . This article does not introduce the use of floating elements, and focuses on the floating skills of DIV blocks.


Assuming that there are two DIV blocks, I hope that the two DIVs can be arranged horizontally through the floating technique, as shown in the following figure:



DIV block floating schematic syntax
#DIV_A {
 float:left;
}
#DIV_B {
 float:left;
}
Suppose the blue block on the left is DIV_A, and the green block on the right is DIV_B. If you want to arrange the two blocks horizontally, you can use the float technique to set float:left to float the elements to the left, so that you can Do DIV to get the effect of horizontal arrangement! You can also use position to locate the position of the DIV block.

Post a Comment

0 Comments