---
layout: single
property_name: margin-right
---
Defines the space outside the element, on the right side.
Removes any margin on the right.
You can use pixel values.
You can use (r)em values. The value is relative to the font size:
You can use percentage values.
The auto keyword will give the right side a share of the remaining space. When combined with
#margin-right
default
margin-right: 0;
margin-right: 50px;
margin-right: 7em;
<html> the root element's font sizemargin-right: 30%;
The percentage is based on the width of the container.margin-right: auto;
margin-left: auto, it will center the element, if a fixed width is defined.