CSS Basics Tutorial: Floating

CSS Float

  • float: Let the element float, values: left (left float), right (right float)

  • The floating element will float to the left or right until it floats to the edge of the surrounding element or to the edge of the previous floating element.

  • Floating elements no longer take up space, and the level of floating elements is higher than that of ordinary elements.

  • Floating elements must be "block elements". No matter what element it originally was.

  • If the floating element does not specify a width, it will be as narrow as possible after floating. Therefore, floating elements generally have a fixed width and height.

  • Multiple elements in a row must be floated together.

Floating function: multiple block elements can be arranged side by side.

    php.cn  
php.cn
php.cn
php.cn

Q: How to surround elements and wrap floating elements?

At this time we need the knowledge in the next section. Under the floating element, use the clear floating operation.



Continuing Learning
||
php.cn
php.cn
php.cn
php.cn
submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!