For developers, float needs to be used frequently, and they are basically inseparable from it, but they often endure all the pain it brings to you. Maybe you think it has only a little knowledge, but you really Can you control it? CSS float is what we call label objects floating to the left (float:left) and floating to the right (float:right). Floating can be understood as making a DIV element break away from the standard flow and float on the standard flow. It is not at the same level as the standard flow. This chapter will talk about how to use float.
You can first learn free courses related to php Chinese website
1. Learn "CSS Online Manual" CSS Float(Floating) Course
2. Watch "Dark Horse Programmer CSS Video Tutorial" The floating chapter in
#float floating related content
1.Detailed explanation of the usage of float that you don’t know
The original design intention of float is to achieve a mixed arrangement of pictures and text, so that the text can surround the picture. Today's usage is basically to achieve horizontal layout. Although it is a "misuse", it can often achieve the effect we want. Most people know how to use float, but not everyone knows the principle and original design intention of float. 2.css float-float/clear detailed graphic and text explanation
If a p element A is floating, and if the previous element of A element is also floating, Then the A element will follow the previous element (if these two elements cannot be placed on one line, then the A element will be squeezed to the next line); if the previous element of the A element is an element in the standard stream, then the relative verticality of A The position will not change, which means that the top of A is always aligned with the bottom of the previous element. 3.The correct usage of float, 90% of people use it incorrectly
float also has a very useful feature, which is to clear spaces. I won’t post a picture of this, just a description. For example, if I put a picture in a p, there will be a few pixels of space between the pictures by default, which can also be called a gap. But often this gap or space is not what we need. At this time, we only need to give the image a float to separate it from the document flow, and the images will fit together perfectly. 4.Two ways to adapt the height of multiple div floating floats in css
When using Div + CSS for three-column or two-column layout, make two columns (or three columns) have the same height, which is easy to achieve with Table, but it is more troublesome to use Div + CSS. According to the general practice, most of them use background image filling or JS script to make the height the same. 5.Detailed explanation of float floating in CSS
The origin of a.floatThe original design of floating is used to create a wrapping effect for text, which is also the design What the author wants us to do.
b.float parameters There are three parameter values for the float attribute: Left: Indicates that the element floats on the left. Right: Indicates that the element floats to the right. None: The object does not float and follows the standard document flow. c. Effect display (take float: left as an example, the case of float: right is just a difference in position) 6.CSS basic knowledge - detailed introduction to float
Floating has 4 attributes: left (left floating), right (right floating), none (not floating), inherit (inherit).The containing block of a floating element is its nearest block-level ancestor element.
The floating element will be offset left (or right) until its outer boundary touches the "inner boundary of the containing block" or "the outer boundary of another floated element".Related Questions and Answers
1.How to solve the problem of float elements falling
2.When using the float attribute in html, the height of the parent element will become 0. How to solve it?
3. Under what circumstances will float fail?
【Related Recommendations】
1. Free tutorial on php Chinese website: "CSS 0 Basic Introductory Tutorial"
2. php Chinese Free online video tutorial: "php.cn Dugu Jiujian (2) - css video tutorial"
The above is the detailed content of How to use float? css: float floating usage summary. For more information, please follow other related articles on the PHP Chinese website!

在css中,可用list-style-type属性来去掉ul的圆点标记,语法为“ul{list-style-type:none}”;list-style-type属性可设置列表项标记的类型,当值为“none”可不定义标记,也可去除已有标记。

区别是:css是层叠样式表单,是将样式信息与网页内容分离的一种标记语言,主要用来设计网页的样式,还可以对网页各元素进行格式化;xml是可扩展标记语言,是一种数据存储语言,用于使用简单的标记描述数据,将文档分成许多部件并对这些部件加以标识。

在css中,可以利用cursor属性实现鼠标隐藏效果,该属性用于定义鼠标指针放在一个元素边界范围内时所用的光标形状,当属性值设置为none时,就可以实现鼠标隐藏效果,语法为“元素{cursor:none}”。

在css中,可以利用“font-style”属性设置i元素不是斜体样式,该属性用于指定文本的字体样式,当属性值设置为“normal”时,会显示元素的标准字体样式,语法为“i元素{font-style:normal}”。

在css中,rtl是“right-to-left”的缩写,是从右往左的意思,指的是内联内容从右往左依次排布,是direction属性的一个属性值;该属性规定了文本的方向和书写方向,语法为“元素{direction:rtl}”。

转换方法:1、给英文元素添加“text-transform: uppercase;”样式,可将所有的英文字母都变成大写;2、给英文元素添加“text-transform:capitalize;”样式,可将英文文本中每个单词的首字母变为大写。

在css3中,可以用“transform-origin”属性设置rotate的旋转中心点,该属性可更改转换元素的位置,第一个参数设置x轴的旋转位置,第二个参数设置y轴旋转位置,语法为“transform-origin:x轴位置 y轴位置”。


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.