There are two borders with different background colors. No matter which side is higher, the other side will also become higher to achieve adaptive more negative margin effects. For related articles, please pay attention to the PHP Chinese website!
1. The effect of negative margin
##Introduction: .There are two borders with different background colors. No matter which side increases in height, the other side also becomes taller
2. CSS Article Absolute Centering Techniques for Absolute Positioning Elements
Introduction: Generally, absolutely position the element in the center, left:50%;top:50%; then Negative margin values or transformation can also achieve the effect. I found another trick today. Use top, left, right, and bottom to set the value to 0, and then magin:auto to achieve centering. Reason:
3. Briefly talk about the role of negative margin values
##Introduction: We all use margin in CSS, but setting margin to a negative number may not be easy to handle. Negative margin values are not a hack. Negative margin values follow the document flow; if you use negative margin values If an element is moved upward, related elements will also be displaced accordingly; negative margin values are well compatible with various browsers.
4.
In-depth understanding of negative margin values in CSS_html/css_WEB-ITnose
Introduction: In-depth understanding Negative margin values in CSS5.
In-depth understanding of negative margin values in CSS-The Blue Ideal of Little Matches
Introduction: In-depth understanding of negative margin values in CSS - The blue ideal of small matches[Related Q&A recommendations]:
javascript - Can float + percentage be used in three-column layout?
The above is the detailed content of 10 recommended articles about negative margins. For more information, please follow other related articles on the PHP Chinese website!