25 lines
1.1 KiB
Markdown
25 lines
1.1 KiB
Markdown
---
|
||
title: Add a Negative Margin to an Element
|
||
localeTitle: Добавить отрицательную маржу к элементу
|
||
---
|
||
## Добавить отрицательную маржу к элементу
|
||
|
||
Маржа - это расстояние между границей элемента и другими элементами на странице.
|
||
|
||
• Расстояние сверху, справа, снизу и слева.
|
||
|
||
• Число в [единицах css](https://www.tutorialspoint.com/css/css_measurement_units.htm)
|
||
|
||
Например, чтобы отрегулировать маржу элемента, который будет отрицательным, вы можете использовать:
|
||
|
||
```css
|
||
.example {
|
||
margin: -10px;
|
||
}
|
||
```
|
||
|
||
**Чтобы настроить прокладку отдельного элемента,** используйте: padding: `-10` px;
|
||
|
||
[Вы можете узнать больше об отрицательных маржах здесь](https://www.smashingmagazine.com/2009/07/the-definitive-guide-to-using-negative-margins/)
|
||
|
||
Удачи! |