What is the use of * {margin: 0; padding: 0;} in the CSS of the webpage? marginpadding
* The wildcard is used to match all elements on the page.
* {Margin: 0; padding: 0;} As 2L said, body, ul, li, p, h1 ~ H6, dd, dt ...... All have default margin or padding values,
Add this statement to delete the default values of the browser. (Note: it is not convenient to use it)
After you add the above sentence, the page is messy. Of course, because when you do not add it, It is set based on the default margin or padding. if you remove the default value, it will of course be messy.
What should I do? 1. Do not add * {margin: 0; padding: 0;}. 2. Re-calculate the margin or padding value and re-design it.
We recommend that you use the second method for future consideration.
How to independently call div. meinv using * {margin: 0; padding: 0 ;}
You can add it directly after div. meinv.
Div. meinv * {margin: 0; padding: 0 ;}
This means that the values of margin and padding matching all elements in div. meinv are 0.
However, if you add * {margin: 0; padding: 0;} at the beginning, you do not need to add it to div. meinv ......