Some usage of float Left suspension: Float usage Float has a wide range of uses. Here is a brief introduction to its most common uses:
The first phenomenon is float=inline-block When suspended, the four blocks will be displayed in inline block mode: as shown below <style> div{ width:200px; height:200px; background-color: pink; border:1px solid black; float:left; } </style> <body> <div></div> <div></div> <div></div> <div></div> </body> The second phenomenon: As shown in the figure below, since the first block element is floating, the second block element will be displayed below the first one. <style> .first-one{ float:left; background-color:green; } .second-one{ background-color:purple; } .third-one{ background-color:blue; } .fourth-one{ float:left; background-color:grey; } div{ width:200px; height:200px; background-color: pink; border:1px solid black; font-size:30px; } </style> <body> <div class="first-one"></div> <div class="second-one"></div> <div class="third-one"></div> <div class="fourth-one"></div> </body> The third phenomenon: If all elements are floated, and the remaining width of the parent element is not enough to support the child elements in the row, then they will be aligned to the upper level. This article is transferred from: https://segmentfault.com/a/1190000022669455 Summarize This is the end of this article about the usage of HTML float. For more relevant HTML float content, please search 123WORDPRESS.COM’s previous articles or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! |
<<: Detailed explanation of JavaScript's Set data structure
>>: MySQL index principle and query optimization detailed explanation
Table of contents 1. Phenomenon 2. Solution 3. Su...
Today I learned to install MySQL, and some proble...
Prerequisite: nginx needs to have the ngx_http_li...
[LeetCode] 178.Rank Scores Write a SQL query to r...
Background: Linux server file upload and download...
1. Element time selection submission format conve...
This article shares two methods of implementing t...
Prelude We all know that nginx is an excellent re...
Current demand: There are two tables, group and f...
1. Introduction Git is a free, open source distri...
Table of contents Event Loop miscroTask (microtas...
Table of contents 1. Download 2. Install nginx an...
Before reading this article, I hope you have a ba...
privot is the intermediate table of many-to-many ...
1: Check the PHP version after entering the termi...