The doubts about position

Source: Internet
Author: User

It is not clear to me now what the effect of position is, or what circumstances need to be specified for relatieve and what circumstances need absolute?

  • <div style= "Position:relatieve" >

    <p data-indent= "1" > <span style= "position:absolute;left:10px;top10px;" > </span >

    </div >

    Above is an example of using position when you need to specify the position of an element relative to its parent element

    The outer element is set to Position:relatieve and the inner element is set to Position:absolute;

    You can then set the position of the inner element relative to the outer element by left, top, bottom, right.

    • I tried it, too:

      The parent element is the absolute child element as absolute, and the effect is that two rectangles intersect each other but do not completely overwrite

      The parent element is the relative child element as relative, and the effect is that the parent element overrides the child element

      When the parent element is a absolute child element as relative, the effect is that the parent element overrides the child element

      The parent element is the relative child element as relative, and the effect is that the parent element overrides the child element

      I now understand the circumstances of the use of position, but do not understand how we determine whether the effect is relative or absolute, can you elaborate on the next? Kazakhstan

The doubts about position

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.