Just use the simple left floating in CSS
HTML code: a big div inside there are four small
Look at a simple drawing analogy, I just want to ask, there are now four floating block, when I add 5 pieces, why don't the fifth block appeared in position at position 1 and 2?
A few blog, baidu search inside some mention this phenomenon, but didn't give the corresponding explanation
Page to run the picture
Extract a blog data, the data of 4.3 didn't explain through
Which brother to give directions, I confused the whole morning!
CodePudding user response:
How did you write your contain
CodePudding user response:
The
1/f, reference 姎 jacaranda response: how did you write your contain The container is simply limit width, center The container { display: block; Max - width: 1080 px; margin: 0 auto; } CodePudding user response:
refer to the second floor small ah small dou response: Quote: refer to 1st floor 姎 jacaranda response: How did you write your contain The container is simply limit width, center The container { display: block; Max - width: 1080 px; margin: 0 auto; } directly to the code perhaps the bosses can understand CodePudding user response:
refer to the second floor small ah small dou response: Quote: refer to 1st floor 姎 jacaranda response: How did you write your contain The container is simply limit width, center The container { display: block; Max - width: 1080 px; margin: 0 auto; } As long as you give. Col - 9 set is highly Col - 1, Col - 2, Col - 3, Col - 4, Col - 5, Col - 6, Col - 7, . Col - 8 The col - 9 { display:block; Min - height: 1 px; Width: 300 px; height:30px; float:left; } CodePudding user response:
https://wenda.so.com/q/1532776806217655 CodePudding user response:
First, you need to understand a float related terms "floating reference" (float reference), Floating reference refers to the floating element to align the reference entity, that is "the current line" in the document flow, namely float elements if instead of inline elements and not floating cases should be in the position of the current line, Float elements either left or right float float, float elements with floating reference at the top of the alignment, namely and float elements if not float cases should be aligned at the top of the line, Your fourth floating piece right has no space to put a piece of 5, the fourth after floating piece of document flow will arrive at the fourth floating piece of the next line, 5 pieces of floating reference is a floating piece of the next line, 4 CodePudding user response:
reference 4 o f old beam response: Quote: refer to the second floor small ah small dou response: The Quote: 1/f, reference 姎 jacaranda response: How did you write your contain The container is simply limit width, center The container { display: block; Max - width: 1080 px; margin: 0 auto; } directly to the code perhaps the bosses can understand Got a simple code, the following <meta charset="utf-8"> Test the floating & lt;/title> <style type="text/css"> The container { Max - width: 1080 px; margin: 0 auto; Height: 600 px; Border: 2 px solid black; } . Box1,. Box2. Box3,. Box4,. Box5 { float:left; Border: 2 px solid red; } . Box1 { Width: 20%; height: 40px; } The box2 { Width: 50%; Height: 70 px; } . Box3 { Width: 20%; height: 40px; } . Box4 { Width: 20%; height: 40px; } . Box5 { Width: 20%; height: 20px; } </style> <body>