CSS margin-inline-start Property

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 4 Examples
Layout & Logical Properties

What You’ll Learn

The margin-inline-start property sets outer spacing on the inline-start side of an element using logical layout instead of physical left margin.

01

Inline-Start

Start of inline axis.

02

Logical

Direction aware.

03

Longhand

One side only.

04

Indent

Offset content.

05

RTL safe

International layouts.

06

Default 0

No spacing.

Introduction

The margin-inline-start property in CSS is used to set the logical start margin of an element, depending on the writing mode, text directionality, and text orientation.

This property is useful for creating layouts that support different writing modes, such as left-to-right (LTR) and right-to-left (RTL) languages, without needing to adjust the margin values manually for each direction.

Definition and Usage

Apply margin-inline-start when you need spacing before an element on the inline axis without affecting the inline-end side. Common uses include indenting paragraphs, offsetting icons beside text, and building flexible multilingual layouts.

💡
Beginner Tip

In normal horizontal English pages, margin-inline-start: 20px behaves like margin-left: 20px. If text direction is RTL, the margin moves to the other side automatically.

📝 Syntax

The syntax for the margin-inline-start property is as follows:

syntax.css
element {
  margin-inline-start: value;
}

Here, value can be any valid CSS length, percentage, or global value.

Basic Example

margin-inline-start.css
p {
  margin-inline-start: 20px;
}

⚡ Quick Reference

QuestionAnswer
Initial value0
Applies toAll elements except table display types that use separate border model
InheritedNo
AnimatableYes, as a length
Related shorthandmargin-inline

💎 Property Values

ValueExampleMeaning
Lengthmargin-inline-start: 20px;Fixed value in px, em, rem, etc.
Percentagemargin-inline-start: 10%;Percentage relative to the inline size of the containing block
automargin-inline-start: auto;The browser calculates the margin automatically
initialmargin-inline-start: initial;Sets the property to its default value (0)
inheritmargin-inline-start: inherit;Inherits the property from the parent element
inline-start

🎯 Default Value

The default value of the margin-inline-start property is 0, which means no margin is applied to the start of the inline axis. Override it when you need spacing before an element on the inline axis.

👀 Live Preview

A box with inline-start margin inside a dashed container:

margin-inline-start: 1.25rem

Examples Gallery

Add inline-start margin to a paragraph, indent nested content, see RTL direction behavior, and compare with physical margin-left.

🔢 Inline-Start Spacing

Start with the reference example — apply margin at the start of the inline axis on a paragraph.

Example 1 — Paragraph Inline-Start Margin

Apply a margin at the start of the inline axis to a paragraph element.

margin-inline-start.html
<style>
  p {
    margin-inline-start: 20px;
  }
</style>

<p>This paragraph has a margin at the start of the inline axis.</p>

In this example, the paragraph has a margin of 20px at the start of the inline axis. If the text direction is LTR, the margin will be on the left; if the text direction is RTL, the margin will be on the right.

Try It Yourself

How It Works

In LTR writing, inline-start maps to the left. The gap appears before the paragraph content on the inline axis.

Example 2 — Indented Content Block

Use inline-start margin to indent a quote or nested block.

margin-inline-start-indent.css
blockquote {
  margin-inline-start: 2rem;
  padding: 1rem;
  border-inline-start: 4px solid #2563eb;
  background: #f8fafc;
}
Try It Yourself

How It Works

Inline-start margin pushes the block away from the start edge, creating a visual indent that adapts to text direction.

📈 Direction & Comparison

See why logical inline-start margins matter when text direction changes, and how they relate to physical margins.

Example 3 — RTL Direction Adaptation

The same margin-inline-start rule follows the inline axis when direction changes to RTL.

margin-inline-start-rtl.css
.note {
  margin-inline-start: 1rem;
  padding: 0.75rem;
  background: #eff6ff;
}

.rtl {
  direction: rtl;
}

LTR (direction: ltr)

Inline-start is left

RTL (direction: rtl)

Inline-start is right
Try It Yourself

How It Works

Logical inline margins swap sides automatically in RTL. Physical left/right margins would not adapt the same way.

Example 4 — Logical vs Physical

In horizontal LTR writing, these two rules produce the same visual result:

margin-inline-start-compare.css
/* Logical */
.card {
  margin-inline-start: 1.5rem;
}

/* Physical equivalent in horizontal LTR */
.card {
  margin-left: 1.5rem;
}
Try It Yourself

How It Works

Choose logical properties when layouts must adapt to direction. Physical margins are fine for simple single-language LTR pages.

Logical vs Physical Margins

LogicalPhysical (horizontal LTR)
margin-inline-startmargin-left
margin-inline-endmargin-right
margin-block-startmargin-top
margin-block-endmargin-bottom

♿ Accessibility

  • Preserve reading order — Logical margins respect direction, which helps RTL and multilingual users.
  • Keep indentation meaningful — Inline-start margin can indent quotes and nested content without breaking semantics.
  • Avoid negative margins on focusable elements — Negative inline-start margins can overlap previous interactive controls.
  • Test zoom and small screens — Large inline-start margins can push content off-screen on narrow viewports.
  • Use semantic HTML — Margins adjust spacing; structure still comes from proper elements.

🧠 How margin-inline-start Works

1

You set inline-start spacing

Apply margin-inline-start with a length, percentage, or keyword.

CSS rule
2

Browser resolves inline-start

The inline-start side is determined by writing mode and text direction.

Logical layout
3

Outer space is added

Transparent margin appears before the element on the inline axis.

Box model
=

Clear offset

Content before the element stays separated on the inline axis.

🖥 Browser Compatibility

The margin-inline-start property is widely supported in modern browsers, including the latest versions of Chrome, Firefox, Safari, Edge, and Opera. It provides a logical, rather than physical, way of setting margins, making it particularly useful for multilingual websites.

Modern browsers · Logical properties

Reliable in current browser versions

margin-inline-start is part of the CSS Logical Properties module. Use it in modern projects; provide physical fallbacks only if you must support very old browsers.

96% Global browser support
Google Chrome 87+ · Desktop & Mobile
Full support
Mozilla Firefox 66+ · Desktop & Mobile
Full support
Apple Safari 14.1+ · macOS & iOS
Full support
Microsoft Edge 87+ · Chromium
Full support
Opera 73+ · Modern
Full support
margin-inline-start property 96% supported

Bottom line: Safe for modern sites. For inline-end spacing, see margin-inline-end.

🎉 Conclusion

The margin-inline-start property is a powerful tool for web developers looking to create flexible and responsive layouts that support different writing modes and text directions.

By using this property, you can ensure consistent spacing and alignment across various languages and cultural settings. Experiment with different values and see how this property can enhance your website’s design and usability.

💡 Best Practices

✅ Do

  • Use margin-inline-start for indents and horizontal offsets
  • Prefer rem for scalable inline-start spacing
  • Pair with logical padding and borders for consistent layouts
  • Test with direction: rtl on international UIs
  • Combine with margin-inline-end for full inline-axis control

❌ Don’t

  • Assume inline-start always means left in every layout
  • Mix logical and physical margins on the same axis without reason
  • Use huge fixed margins that break mobile layouts
  • Rely on physical left/right when direction may change
  • Skip browser testing for older Safari versions

Key Takeaways

Knowledge Unlocked

Five things to remember about margin-inline-start

Use these points when spacing elements on the inline-start side.

5
Core concepts
0 02

Default 0

No spacing.

Default
LH 03

Longhand

One side.

Type
RTL 04

Direction

Adapts flow.

Logical
i18n 05

RTL safe

Global layouts.

Use case

❓ Frequently Asked Questions

The margin-inline-start property sets outer spacing on the inline-start side of an element. In horizontal left-to-right writing, that is usually the left margin.
The default value is 0, meaning no inline-start margin unless you set one explicitly.
margin-left always targets the physical left edge. margin-inline-start follows text direction, so spacing stays correct in RTL layouts.
margin-inline is shorthand for margin-inline-start and margin-inline-end. Use margin-inline-start when you only need spacing on the inline-start side.
Use it for spacing before an element on the inline axis, such as indenting content, offsetting icons, or aligning blocks in multilingual layouts.

Practice in the Live Editor

Open the HTML editor, try different margin-inline-start values, and see how inline-start spacing changes your layout.

HTML Editor →

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.

5 people found this page helpful