1. Basic usage examples of float 1. Let's first create two div boxes and set the height, width and background color; The initial positions of the two boxes on the web page are as follows: Then we float the red box to the right Then we will find that the red box floats to the right, but the blue box moves directly up to the original position of the red box. Then we float the blue box to the right to see the effect: We will find that it will be arranged closely following the red box and will not be affected by the block-level elements and occupy a single line. 2. Basic rules of floating positioning 1. When the float attribute of an element is left or right, the element is floating; 2. If there is not enough space left to hold the floating box, the box moves down until there is enough space to hold the box, and then moves left or right; 3. The top edge of the floating box must not be higher than the top edge of the previous box; 4. When placing floating boxes, avoid regular flow boxes; when placing regular flow boxes, ignore floating boxes; 5. When calculating the automatic height of the regular flow box, the floating box is ignored 6. Clear float: clear:both (left or right). Summarize The above is a detailed example of the usage of float in HTML/CSS introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! |
<<: Web Design Tutorial (7): Improving Web Design Efficiency
>>: How to make spaces have the same width in IE and FF?
1. Paradigm The English name of the paradigm is N...
more is one of our most commonly used tools. The ...
today select * from table name where to_days(time...
Solution process: Method 1: The default kernel ve...
If there is a table product with a field add_time...
We often need to control the hidden, transparent ...
<br /> Note: All texts, except those indicat...
The most important interactive design article in ...
Open the cpanel management backend, under the &qu...
Environmental requirements: IP hostname 192.168.1...
Table of contents 1. Introduction: 2. The first i...
Version 1.4.2 Official Documentation dockerhub st...
MySQL8.0.12 installation tutorial, share with eve...
I am going to review Java these two days, so I wr...
Table of contents Join syntax: 1. InnerJOIN: (Inn...