Htmlcss Notes--positioning

Source: Internet
Author: User

1. Positioning:

Position:relative (relative)

Does not affect the characteristics of the element itself;

does not cause the element to infer the original document flow; it also occupies the seat.

Position element Control: Top/right/bottom/left locates the element offset.

Absolute (absolute positioning)

Leave the element out of the document flow,

Enables inline elements to support wide heights,

Fast attribute tag content open width.

Offset relative to the entire document, not relative to its original position or body to offset;

* If there is a target parent, it is positioned relative to the location parent, and if not, relative to the document location

Relative positioning is generally used in conjunction with absolute positioning.

  

Anchor element default the latter hierarchy is higher than the former.

Positioning hierarchy: Z-index:[number]; Default 0

   

2. Transparency: IE incompatible; Standard: opacity: opacity:0~1;

IE private: Filter:alpha (opacity=0~100);

    

3.

The landing frame is centered with the entire page:

POSITION:ABSOLUTE;TOP:50%;LEFT:50%;MARGIN-TOP:-APX;MARGIN-LEFT:-BPX;

A is the height of the landing frame, B is the width of the landing frame, also consider the border, the padding, etc.

4.pisition:fixed;

fixed positioning;

The characteristics and absolute positioning are basically consistent, the difference is always relative to the entire document positioning;

IE6 does not support fixed positioning, if need to be compatible with JS positioning.

5.position:inherit;

Inherit from parent, not basic.

6.position:static;

Default inheritance;

Htmlcss Notes--positioning

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.