How to use negative margin
This article mainly shows you "how to use negative margin". The content is simple and easy to understand, and the organization is clear. I hope it can help you solve your doubts. Let Xiaobian lead you to study and learn this article "how to use negative margin".
1. Realize left and right two-column layout
Method 1:
left right side
Method 2:
left right side
Comparing the two methods, the first one uses float, the disadvantage is that the application of float in IE may cause a lot of bugs, the second one uses-margin, the ability is still relatively good, temporarily did not find no problem;
2. navigation bar
Document *{ margin: 0; border: 0; padding: 0; } ul{ overflow: hidden; } ul li{ background: #999; border-left: 1px solid #000; width:60px; height:30px; float: left; list-style: none; text-align: center; margin-left:-1px; } 1 2 3
Or:
Document *{ margin: 0; border: 0; padding: 0; } ul{ } ul li{ background: #999; border-left: 1px solid #000; border-right: 1px solid #000; width:60px; height:30px; float: left; list-style: none; text-align: center; margin-left:-1px; } 1 2 3
Use overflow and-margin appropriately.
The above is all the contents of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!