Htmlcss notes -- positioning, htmlcss notes --

Source: Internet
Author: User

Htmlcss notes -- positioning, htmlcss notes --

1. positioning:

Position: relative (relative)

Does not affect the features of elements;

Do not make element reasoning for the original document stream; it also occupies the seat.

Positioning element control: top/right/bottom/left positioning element offset.

Absolute (absolute positioning)

Disconnects elements from document streams,

Enable embedded elements to support width and height,

The width of the content of the quick attribute label is extended.

The offset relative to the entire document is not offset relative to its original position or body;

* If the parent level is located, the parent level is located relative to the parent level. If no parent level is located, the parent level is located relative to the document level.

Relative positioning is generally used in combination with absolute positioning.

The default level of the positioning element is higher than that of the former.

Positioning level: z-index: [number]; default value: 0

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

Private ie: filter: alpha (opacity = 0 ~ 100 );

3.

Center the login box and the entire page:

Position: absolute; top: 50%; left: 50%; margin-top:-retrial; margin-left:-Bpx;

A is the height of the logon box, B is the width of the logon box, and the border and padding must be considered,

4. pisition: fixed;

Fixed positioning;

Features are basically the same as absolute positioning, and the difference is that they are always located relative to the entire document;

Ie6 does not support fixed positioning. If compatible, it must be used with JS positioning.

5. position: inherit;

Inherited from the parent level, basically not required.

6. position: static;

Default inheritance;

Related Article

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.