Home  >  Article  >  Web Front-end  >  10 recommended articles about negative margins

10 recommended articles about negative margins

零下一度
零下一度Original
2017-06-14 09:34:481655browse

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

10 recommended articles about negative margins

##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

10 recommended articles about negative margins

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

10 recommended articles about negative margins

##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 CSS

5.

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn