CSS Portal

CSS margin-inline-start Property

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!

Description

The margin-inline-start CSS property controls the logical margin on the "start" side of an element's inline axis. In practical terms it creates space between the element and whatever lies at the beginning of the inline flow for that element. Which physical edge it corresponds to (left, right, top or bottom) is determined by the element’s writing direction and script orientation, so the same rule adapts automatically for left-to-right vs right-to-left text and for vertical writing modes.

Because it is a logical property, margin-inline-start is intended to replace hard-coded physical margins (for example, when you would otherwise use margin-left) so your layout behaves correctly across languages and writing directions. It applies to block-level boxes and to inline-level boxes with slightly different effects: on block-level boxes it affects how the box is offset inside its containing block along the inline axis and influences available inline space; on inline-level boxes it affects spacing at the start edge of the inline box and therefore can alter line breaking and text flow. Unlike block-axis start/end margins, inline margins do not participate in the margin-collapsing rules that govern vertical (block-axis) margins.

Practical use of margin-inline-start is mainly about creating direction-agnostic spacing and simplifying internationalization: prefer it over physical properties when you want consistent start-side spacing regardless of writing-mode or text direction. It pairs naturally with its logical counterpart margin-inline-end and with logical shorthands such as margin, enabling symmetric or asymmetric inline spacing without switching values for different locales. Because logical properties resolve based on writing-mode and direction, using them reduces the need for runtime swapping of CSS rules when supporting RTL languages or vertical text.

Definition

Initial value
0
Applies to
same as margin
Inherited
no
Computed value
if specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, auto
Animatable
a length
JavaScript syntax
object.style.marginInlineStart

Interactive Demo

One
Two
Three

Syntax

margin-inline-start: <margin-top> 

Values

  • <margin-top>Specifies margin-block in px, pt, cm, etc. Negative values are allowed.

Example

<div class="examples">
<section class="example example-ltr" dir="ltr">
<h2>LTR (margin-inline-start → left)</h2>
<div class="box">Item</div>
</section>

<section class="example example-rtl" dir="rtl">
<h2>RTL (margin-inline-start → right)</h2>
<div class="box">Item</div>
</section>
</div>
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    padding: 1rem;
    background: #f8f9fa;
    color: #111;
}

.examples {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.example {
    flex: 1 1 280px;
    padding: 1rem;
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
}

.example h2 {
    font-size: 0.95rem;
    margin: 0 0 0.75rem 0;
    font-weight: 600;
}

.box {
    display: inline-block;
    padding: 0.75rem 1rem;
    background: #0d6efd;
    color: #fff;
    border-radius: 6px;
    margin-inline-start: 1.5rem;
}

Browser Support

The following information will show you the current browser support for the CSS margin-inline-start property. Hover over a browser icon to see the version that first introduced support for this CSS property.

This property is supported by all modern browsers.
Desktop
Chrome
Edge
Firefox
Opera
Safari
Tablets & Mobile
Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-

Last updated by CSSPortal on: 1st January 2026

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!