Position properties in CSS

Source: Internet
Author: User
The Position property in CSS is the positioning type of the set element, it has a absolute (absolute positioning), relative (relative positioning), static (static positioning, default), fixed (stationary positioning) four parameters.

    • Static: Default. An element with a position set to static, which is always in the position given by the page stream (the static element ignores any top, bottom, left, or right declarations).

    • Relative: The position is set to an element of relative and can be moved to a location relative to its normal position, so "left:20" moves the element to a position 20 pixels to the left of the element's normal position.

    • Absolute: An element whose position is set to absolute and can be positioned relative to the specified coordinates of the element containing it. The position of this element can be specified by the "left", "Top", "right" and "bottom" properties.

    • Fixed: The position is set to the fixed element and can be positioned relative to the specified coordinates of the browser window. The position of this element can be specified by the "left", "Top", "right" and "bottom" properties. The elements remain in that position, regardless of whether the window is scrolled or not. Works in IE7 (Strict mode).

Example

Using the Position property to locate the

<! DOCTYPE html>

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.