Line elements within the default margins issue

Default margins between the rows / lines within a block element is about 5px

Between the rows of the block elements, the browser will have block elements within a default line spacing, or other elements come directly cast, there will be a browser default spacing.

By * {margin: 0; padding: 0;} is not cancel inherent margin

Solution:

1. The block elements in all the rows / lines directly floating, but excessive floating generates necessary to clear the floating
parent element disposed property 2. In the line generated margins blocks in / line: font-size: 0px; (Recommended use)
3. disposed on the parent element, the value of word-spacing (padding word) is set to a negative value suitable
4. / row within the block elements in the same row in the line display html, indented or not to carry out beautiful wrap

Guess you like

Origin www.cnblogs.com/chm-blogs/p/11280312.html