Let's briefly talk about the role of negative margin values

高洛峰
Release: 2017-02-09 11:47:08
Original
1885 people have browsed it

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, and negative margin values ​​follow the document flow; if negative margin values ​​are used to move an element upward, then it is relevant Elements will also be displaced accordingly; negative margin values ​​are well compatible with various browsers.

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

Lets briefly talk about the role of negative margin values

2. Implement adaptive

Lets briefly talk about the role of negative margin values

More briefly talk about negative margin values For articles related to its functions, please pay attention to the PHP Chinese website!

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!