What are viewport segments on foldable screens?

Viewport segments are the logical regions created when a hardware fold or hinge divides the browser viewport. A dual-screen device may expose left and right segments, while another posture may create top and bottom segments. Each segment has its own position and dimensions within one page viewport.
CSS media features report the segment count. horizontal-viewport-segments: 2 describes two side-by-side regions; vertical-viewport-segments: 2 describes two stacked regions. These conditions are false on an ordinary undivided viewport, so the standard responsive layout remains the natural fallback.
Environment variables expose indexed geometry such as viewport-segment-width 0 0 and viewport-segment-left 1 0. The first index is the column and the second is the row. The space between one segment’s right edge and the next segment’s left edge represents the divider or hinge area.
@media (horizontal-viewport-segments: 2) {
.master {
width: env(viewport-segment-width 0 0);
}
.detail {
width: env(viewport-segment-width 1 0);
left: env(viewport-segment-left 1 0);
}
}
Segment variables exist only while the viewport has multiple logical regions. Do not use one as the sole width for the base page. Keep declarations inside a matching segment query or provide a safe fallback in env. Browser and device support should be checked before making the dual-pane arrangement part of a required workflow.
Useful segment layouts include master-detail views, reading pages with notes, and media controls separated from content. Avoid splitting one paragraph, form field or control across the hinge. Test keyboard focus order and screen-reader reading order because the visual panes still belong to one document and one navigation sequence.