Difference between padding-top, margin-top and top, and marginpadding

Source: Internet
Author: User

Difference between padding-top, margin-top and top, and marginpadding

Padding-top: 10px indicates that the content in the container is 10 pixels away from the top of the container and is contained in the container;

Margin-top: 10px indicates that the container is at the top of the container and is 10 pixels away from other containers, not included in the container;

Top: 10px, which indicates that the container is 10 pixels above the top of the page.


What is the difference between padding-top and margin-top?

I'm using padding now.
It seems that some styles have no effect after being defined by padding.
With margin, you can

What is the difference between margin-top and top in css?

Margin: top 19px; and margin: 19px 0 0 0; both indicate that the blank side of the container is 19PX.
TOP: 19PX indicates the position distance from 19PX.

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.