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
Parent File import React, { useState } from '...
1. Create a database authorization statement >...
Using CI to build docker images for release has g...
Table of contents Use two-way binding data in v-m...
1. Virtual Machine Preparation 1. Create a new vi...
1. Overview The information_schema database is th...
Analyze the execution process. Move the mouse int...
mysql id starts from 1 and increases automaticall...
Table of contents Preface How does antd encapsula...
This article example shares the specific code for...
Table of contents Find and fix table conflicts Up...
Table of contents 1 What is SSH 2 Configure SSH p...
I will use three days to complete the static page...
Use of AES encryption Data transmission encryptio...
1. Time types are divided into: 1. Network time (...