Home > Web Front-end > HTML Tutorial > About float and position_html/css_WEB-ITnose in CSS

About float and position_html/css_WEB-ITnose in CSS

WBOY
Release: 2016-06-24 11:51:39
Original
1107 people have browsed it

position:relative is the relative positioning of child block-level elements to parent elements. The positioning keywords use left/right/top/bottom. The sibling block elements are positioned relative to each other, but after the position is moved, the original position is still retained. And subsequent positioning of sibling block elements is based on the position before being removed.

float:right/left is the positioning of the sub-block-level element flow collection towards the parent element, and the positioning keywords use margin/padding. The relative positioning between sibling block elements is re-rendered based on the new position after movement. They can overlap and the original position is cleared.

The biggest difference between the two is position reservation.

float positioning:


  • li1

  • li2

  • li3

position: relative positioning:



  • li1

  • li2

  • < li id=li3>li3

Run them separately to check the running effect.

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template