Oral interpretation allows you to understand relative positioning and absolute positioning of web pages

Source: Internet
Author: User
Tags define definition relative
Web page

When I first started to learn, I was not quite sure what the difference was, after many practices and the definition of understanding, just gradually understand come, as we usually said will be not difficult, difficult will not

1. First of all, relative positioning position:relative: is relative to its own position in the document, such as we queued, you are in the third position, if the relative positioning we can only be relative to yourself, that is, relative to the third position, If I'm out of line with that position, my third position will remain, that is, although I was out of the team, but that place still exists, or mine, but no one, occupy an empty position, as if to say too much crap, but this is mainly to make you more accurate understanding!

  add: usually in a lot of Web site style table will see style: position:relative; this is useful, although there is no definition left,right etc, the page does not show any effect, but it is useful, please go down to the 2nd.

2.Position:absolute| Absolute positioning: relative to an "element" positioning, such as we usually use the absolute positioning of the default is opposite to the body, if you want to define as compared to the previous level elements, your approach is to define the superior elements for the position: Relative, so you can do whatever you want!

  Summary: If you can understand the above two, then you use these two basic principles must be able to do for your use, will not let you do not know the wrong! There are a lot of tutorials on the web that say the problem of positioning is similar and too written. So I use the spoken language to say these, hope to can't understand, want to understand good scholar to have help!



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.