Home > Web Front-end > CSS Tutorial > A brief discussion on the role of negative margin values

A brief discussion on the role of negative margin values

小云云
Release: 2017-12-26 09:41:19
Original
2324 people have browsed it

This article mainly talks about the role of negative margin values. 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 ​​to move an element upward, the related elements will also shift accordingly; negative margin values ​​are well compatible with various browsers.

1. There are two borders with different background colors. No matter which side increases in height, the other side also becomes higher.

2. Implement adaptive

Related recommendations:

A brief analysis of negative margin values

About negative margin values 10 articles recommended

Briefly talk about the role of negative margin

The above is the detailed content of A brief discussion on the role of negative margin values. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
Statement of this Website
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
Latest Issues
html - Ask about margin-top
From 1970-01-01 08:00:00
0
0
0
Why doesn't this CSS margin-top style work?
From 1970-01-01 08:00:00
0
0
0
How to disable margin folding
From 1970-01-01 08:00:00
0
0
0
"Unrendered margin-top is on fieldset's legend"
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template