Web page css in *{margin:0; padding:0;} What's the use?

Source: Internet
Author: User
*  This thing is called a wildcard to match all the elements on the page.
*{margin:0; padding:0;} Like 2L said, body, UL, Li, P,h1~h6,dd,dt, etc... has a default margin or padding value,
With this sentence you can remove the browser these default values, and the following settings. (Note: Not without it, just convenient)

You add the sentence after the page chaos, it is of course, because you do not have the overtime is based on the default margin or padding set, remove the default value, of course, will be messy.
Do how One, is not add *{margin:0; padding:0;} The second is to recalculate the margin or padding value yourself and redesign
Suggest the second kind, after all for the sake of later.

How to call DIV.MEINV alone with *{margin:0; padding:0;}

Add it directly behind the DIV.MEINV.
DIV.MEINV *{margin:0; padding:0;}
This means that the values of margin and padding for all elements under match DIV.MEINV are 0.
However, if you add *{margin:0 to the front; padding:0;} This sentence, there is no need to add on the DIV.MEINV ...

Web page css in *{margin:0; padding:0;} What's the use?

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.