Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

CSS logical properties describe layout relative to a component’s text and block flow: for example, margin-inline-start is the left margin in horizontal left-to-right text and the right margin in horizontal right-to-left text. Use them when a layout should adapt to writing direction or writing mode; keep physical properties when a design must stay attached to a particular screen edge.

What are CSS logical properties?

Physical properties name fixed edges or dimensions: left, top, width, and height. Logical properties name positions and sizes in the content’s flow: inline-start, inline-end, block-start, block-end, inline-size, and block-size.

The distinction is about intent, not just shorthand. A physical left always means the left edge. inline-start means the beginning of the text line, which can map to different physical edges depending on the writing context.

How do the block and inline axes work?

Inline follows the line; block follows the stacking direction

The inline axis runs in the direction text proceeds along a line. The block axis is perpendicular to it and follows the direction blocks stack. Neither axis is inherently horizontal or vertical.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
  • In horizontal writing, the inline axis is horizontal and the block axis is vertical.
  • In vertical writing, the inline axis is vertical and the block axis is horizontal.

Writing mode is more than left-to-right versus right-to-left

The mapping is shaped by writing-mode, direction, and text-orientation. Broadly, writing-mode sets block-flow direction, direction sets the inline base direction, and text-orientation affects glyph orientation. A logical property follows that writing context; it is not a permanent alias for a particular physical side.

For example, margin-inline-start maps to the left margin in horizontal LTR, the right margin in horizontal RTL, and can map to the top margin in a vertical writing mode. Use the axes to reason about the result rather than memorizing a fixed translation.

How do logical properties map to physical ones?

This table shows common mappings for horizontal writing. In vertical writing, the inline and block axes change physical orientation, so the corresponding sides change too.

Flow-relative intent Horizontal LTR Horizontal RTL
Inline start Left side Right side
Inline end Right side Left side
Block start Top side Top side
Block end Bottom side Bottom side
Inline size Extent along the horizontal text line Extent along the horizontal text line
Block size Extent perpendicular to the text line Extent perpendicular to the text line

Logical properties are available across several CSS families, not only spacing:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
  • Spacing: margin-inline-start, padding-block, and related longhands and axis shorthands.
  • Sizing: inline-size and block-size, along with their minimum and maximum variants.
  • Borders: logical border sides and border-radius properties.
  • Positioning: inset-inline-start, inset-block-end, and related inset properties.
  • Other flow-sensitive values: logical forms of float and clear, plus alignment values such as start and end.

What is the difference between inline-size and width?

width and height describe physical dimensions. inline-size describes a size along the inline axis, while block-size describes one along the block axis. In horizontal writing, inline-size generally corresponds to width and block-size to height; when the writing mode is vertical, those axes switch physical orientation.

Choose based on the requirement. If a component should keep its size relationship to the text flow across writing modes, use the logical sizing property. If it must have a particular physical width or height regardless of writing mode, use width or height.

How do I replace margin-left with a logical property?

If the margin belongs at the beginning of the text line, replace margin-left with margin-inline-start. If it belongs at the end, use margin-inline-end. If it must remain on the physical left edge in every writing mode, keep margin-left.

For spacing on both sides of an axis, use margin-inline or margin-block. The same approach applies to padding and other properties that provide logical equivalents.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Example: a flow-aware card

.card {
  inline-size: min(100%, 42rem);
  padding-block: 1rem;
  padding-inline: 1.25rem;
  margin-inline: auto;
  border-inline-start: 0.25rem solid currentColor;
}

The card’s size and spacing are expressed along the writing axes. Its start border is on the left in horizontal LTR and on the right in horizontal RTL. This example illustrates the mapping; it is not a browser test.

Example: positioning relative to flow

.badge {
  position: absolute;
  inset-block-start: 0.5rem;
  inset-inline-end: 0.5rem;
}

Here, the badge sits at the block-start and inline-end corners of its positioned containing block. Use top, right, bottom, or left instead when the position is intentionally tied to physical edges, such as a control that must remain at the viewport’s top-right corner.

Do CSS logical properties work with RTL?

Yes: logical properties express flow-relative intent, so inline-start and inline-end follow the inline direction. In horizontal RTL, inline-start is the right side and inline-end is the left. Block-start and block-end still describe the block axis, not the start and end of a text line.

Logical CSS does not, by itself, solve every bidirectional text-ordering issue. Set up text direction appropriately in the document and understand how direction participates in the writing-mode model; use logical properties for layout decisions that should follow that context.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Do CSS logical properties work in vertical writing modes?

They are designed to express layout in terms of the writing axes, including vertical writing modes. In vertical writing, the inline axis becomes vertical and the block axis horizontal. As a result, an inline-start margin may map to a top margin rather than a left or right margin.

When designing for vertical text, determine which axis the requirement refers to first, then select the relevant logical property. Do not assume that “inline” means horizontal or that “block” means vertical.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What shorthand and cascade pitfalls should I watch for?

Four-value shorthands still use physical sides

margin: 1px 2px 3px 4px means top, right, bottom, left, in that order. The same physical-side model applies to four-value padding and border shorthands. These values do not become block-start, inline-end, block-end, and inline-start in RTL or vertical writing.

If the values are meant to follow flow, use logical longhands or logical axis shorthands such as margin-block and padding-inline.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Mixed physical and logical declarations need deliberate cascade order

Corresponding physical and logical properties participate together in the cascade according to the element’s computed writing mode; they are not always independent settings. Changing the writing context can therefore change which physical side corresponds to a logical declaration.

When both forms appear in a rule set, check their order and the computed writing mode instead of assuming one declaration will affect only a separate side. Avoid mixing them casually, especially when a physical declaration is intended as a fallback.

Do not mechanically replace every left or right

A replacement is appropriate only when the layout intent is flow-relative. A fixed-position menu attached to the physical left edge, for example, may properly use left. A decorative border intended to mark the start of a reading line is a better fit for border-inline-start.

How should I choose between physical and logical properties?

  • Choose a logical property when a position, spacing, size, border, or alignment should track the text or block flow.
  • Choose a physical property when the requirement names a fixed screen or physical edge, or a physical width or height.
  • For reusable components expected to appear in RTL or vertical writing, check each layout rule for hidden assumptions about left, right, width, and height.
  • Review shorthands and mixed declarations during migration; changing a longhand alone may not make the whole rule flow-aware.

The W3C CSS Logical Properties and Values Level 1 document is a Working Draft dated 4 December 2025, not a final Recommendation. The documentation available for this guide does not establish a browser-version matrix, so check a current compatibility table before relying on a particular property in a specific support target.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Or skip the browser setup

If you need a screenshot of a rendered page while checking how it looks in different directions, ScreenshotNeo offers a one-request screenshot API. For example, this cURL request captures a page as WebP:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots, and the Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Learn about ScreenshotNeo, or sign up for 1,000 free screenshots a month with no card.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.