In website development, cssfloat is a frequently used css attribute. It is used to set the floating direction (left and right floating) of css block-level elements ). This article introduces the usage and instance application of cssfloat to coders. For more information about coders, see. Float floating attribute of Css, used to set tag objects (for example:
Tag box, Tag, tag,The floating layout of tags and other html tags. float: left, float: left, and float: right ).
What does float mean? Float is floating, and Translation into Chinese is floating. Go to the corresponding css manual to learn the basic information about float.
The function of float: defines float (float) through css to let the p style layer block, float left or right (.
I. float syntax
float : none | left |right
Parameter value:
None: the object is not floating.
Left: the object is floating on the left.
Right: The object is floating on the right.
Next we will explain how to use float through an example.
Ii. float application and usage
Float floating is used to set the floating style of objects to the left and right, so that the DIV, SPAN, and other labels can move left to the right.
Simple syntax
P {float: left}/* css Note: Set p object floating to left (left) */p {float: right}/* css Note: Set p object floating to right (right) */
Iii. Case study of css float
Create a horizontal menu
Use floating to create a hyperlink list for the horizontal menu.
- Link one
- Link two
- Link three
- Link four
Online operation
Iv. css floating Summary
We need to distinguish the text content from the text content to the left (text-align: left) to the right (text-align: right) style. Floating only sets the left-to-right floating style for html tags. Float floating style does not depend on the middle (floating Center) style. If you need to center the label object, we will center the text in the css layout to give you a detailed introduction (css margin ). Remember to use float: right for float to the right and float: left for float to the left.
Related reading:
CSS tutorial
CSS3 tutorial
CSS Reference Manual