CSS margin-inline-start Property

Beginner
5 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The margin-inline-start property sets the logical inline-start margin of an element. It maps to a physical side based on writing-mode and direction.

In horizontal left-to-right layout it usually matches margin-left. In RTL it usually matches margin-right. It is one half of the margin-inline shorthand and is not inherited.

Baseline · Widely available.

Not deprecated. Broad support since about 2020. Prefer it over physical margin-left when direction can change.

CSS Syntax

syntax.css
margin-inline-start: <length> | <percentage> | auto | inherit;

Same value types as other margins. Example: margin-inline-start: 1.5rem;.

Property Values

ValueDescriptionTry it
<length>Fixed start margin such as 16px or 1emTry it
<percentage>Relative to the containing block’s inline sizeTry it
autoBrowser chooses a used value (often with flex/grid or sizing)Try it
With direction: rtlStart maps to the physical right in horizontal RTLTry it
0 / initialNo start margin (initial value is 0)Try it
inheritTakes the parent’s margin-inline-startTry it

How to Use margin-inline-start

Use it for space before an item on the inline axis.

  1. Select the element that needs space on its inline-start side.
  2. Set a length or percentage (for example 1rem).
  3. Prefer this over margin-left when the page may use RTL.
  4. For both sides at once, use margin-inline instead.
PieceRequired?Role
Length / % / autoYesSets the inline-start outer space
Direction / writing modeAffects mappingChooses which physical edge is “start”
InheritedNoSet on each element that needs it
Content before itTo see a gapStart margin pushes the element away from earlier inline content

Live Preview

Change margin-inline-start on the yellow box. The gap appears before it on the inline axis.

In LTR, start is on the left. Toggle RTL in the tryit editor to see it flip.

Inline row
Prev Start

margin-inline-start: 24px

CSS Examples

Each snippet focuses on margin-inline-start. Use Try It Yourself for a live editor.

Example 1 — Start Gap

Add space before a box on the inline axis.

CSS
<style>
  .b {
    margin-inline-start: 24px;
  }
</style>

<span>A</span>
<span class="b">B</span>
Try It Yourself

How It Works

  1. Target the second item. The rule applies to .b.
  2. Set 24px. Outer space appears on the inline-start side.
  3. In LTR, that gap is on the left of B.
  4. A stays before the gap on the inline axis.

Example 2 — Start Side in RTL

The same property flips with direction.

CSS
<style>
  .row {
    direction: rtl;
  }
  .b {
    margin-inline-start: 24px;
  }
</style>

<div class="row">
  <span>A</span>
  <span class="b">B</span>
</div>
Try It Yourself

How It Works

  1. Set direction: rtl. Inline start is on the right.
  2. Start is on the right. The 24px gap appears before B toward the right.
  3. No left/right rewrite. The same CSS works in LTR and RTL.
  4. Compare with margin-left — physical left would not flip.

Example 3 — Indent a Block

Offset content from the inline start of its container.

CSS
<style>
  .note {
    margin-inline-start: 1.5rem;
  }
</style>

<div class="note">Indented note</div>
Try It Yourself

How It Works

  1. Space before the block. Start margin indents from the container’s inline start.
  2. Keeps reading order. Works for LTR and RTL pages.
  3. Outside the box. Background does not extend into the gap.
  4. For inner space, use padding-inline-start instead.

Edge Cases & Pitfalls

If the gap is on the “wrong” side, check these first.

logical

Start is not always left

Mapping depends on direction and writing-mode. In RTL horizontal text, start is typically right; in some vertical modes it can be top or bottom.

vs

Do not mix with margin-left for i18n

If you set both margin-inline-start and margin-left, they can fight depending on cascade and mapping. Pick logical or physical consistently.

shorthand

margin-inline resets both sides

A later margin-inline declaration overrides this longhand. Order your rules carefully.

auto

auto needs leftover space

In a flex row, margin-inline-start: auto can push an item toward the end. A lone block may need a set width for auto to matter.

padding

Margin vs padding-inline-start

Use padding-inline-start when the background should include the space.

Browser Support

margin-inline-start is a browser CSS property for logical margins. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available

margin-inline-start

Supported in all modern browsers (broad support from about 2020). Prefer it for direction-aware start margins.

96% Modern browser support
Google Chrome 69+
Full support
Mozilla Firefox 41+
Full support
Apple Safari 12.1+
Full support
Microsoft Edge 79+
Full support
Opera 56+
Full support
Samsung Internet 10+
Full support
Internet Explorer No support
No support
margin-inline-start Widely supported

Bottom line: Safe for modern sites. Fall back to margin-left/right only for very old browsers. It is not a runtime API.

Key Takeaways

  • Role: outer margin on the logical inline-start side.
  • Initial: 0. Not inherited.
  • Follows direction — better than margin-left for RTL.
  • Pair with end via margin-inline when both sides need space.

One line: use margin-inline-start for space before an element that stays correct when text direction changes.

Frequently Asked Questions

It sets the outer margin on the inline-start side of an element. In horizontal left-to-right layout that is usually the left side; in RTL it is usually the right.
The initial value is 0. There is no inline-start margin until you set one.
margin-left always targets the physical left edge. margin-inline-start follows writing mode and direction, so it stays on the logical start side in RTL and vertical layouts.
margin-inline is the shorthand for margin-inline-start and margin-inline-end. Use the longhand when you only need the start side.
No. Set it on each element that needs start-side spacing.
It is Baseline Widely available (broad support since about 2020). It is a browser CSS property, not a Node.js feature.

Next: margin-left

Set the physical left margin of an element.

margin-left tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful