Home  >  Article  >  Web Front-end  >  How to use negative margin values ​​in CSS

How to use negative margin values ​​in CSS

php中世界最好的语言
php中世界最好的语言Original
2018-03-09 11:54:581631browse

This time I will show you how to use negative values ​​​​in CSS marginWe know that margin in CSS can be set to negative values, so what are the negative values ​​​​of using marginNote Matter , the following is a practical case, let’s take a look.

1.Margin touches first, then border, then padding, then content
2. If the value is negative, it will no longer occupy space
Example:. exmp{ width: 480px; margin-right:-450px; }
will only occupy 30px of horizontal width. If .exmp is set to left floating, then the left floating sibling elements behind .exmp will be arranged after 30px

I believe you have mastered the method after reading the case in this article. For more exciting things, please pay attention to php Chinese website Other related articles!

Related reading:

Use

and paragraph

to write a Sanmao quotation

HTML Improved inline style of "San Mao's Classic Quotations"

CSS(Cascading Style Sheets) collection


The above is the detailed content of How to use negative margin values ​​in CSS. 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