Position property in CSS (absolute/relative/static/fixed)

Source: Internet
Author: User

CSS in position properties (absolute/relative/static/fixed):

Position:static No special positioning, is the default location of HTML elements, objects follow normal document flow. Attributes such as top,right,bottom,left are not applied.

The Position:relative object follows the normal document flow, relative to its original position in the document flow, but offsets the position in the normal document flow based on attributes such as Top,right,bottom,left. And its cascade is defined by the Z-index property.

Position:absolute: objects are detached from normal document flow and are positioned according to ancestor elements (above the parent class), and the ancestor class must be posiiton for non-static mode, using Top,right,bottom, Left and other properties for absolute positioning. And its cascade is defined by the Z-index property. position:fixed: Objects are out of normal document flow, use properties such as top,right,bottom,left to position the window as a reference point, and the object does not scroll when the scroll bar appears. And its cascade is defined by the Z-index property.  Document Flow: The document flows by dividing the form from top to bottom, and emitting elements from left to right in each row. situations in which an element is detached from the document flow: floating absolute positioning

Position property in CSS (absolute/relative/static/fixed)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.