Sub topic 14
Adapting the layout to other formats and screens
This chapter assumes you can already build a text-over-image layout with a grid, a crop that leaves room for type, and a scrim for contrast. It also assumes you have used CSS media queries or Figma frames and constraints. Here you will learn what to change when the same layout has to fit a different shape.
Why a layout does not simply shrink
A layout that works at one size often fails at another. Scaling a poster down to a phone screen makes the headline small, the caption unreadable, and the focal point tiny. Scaling a wide banner into a square cuts off the side of the photo where the text zone was.
Two things change when you adapt a layout:
- Format is the shape and proportions of the canvas, such as 16:9, 1:1, 4:5 or 9:16. Format changes how much horizontal and vertical room you have.
- Screen size is the width of the viewport in pixels. It changes how many grid columns fit and how large type must be to stay readable.
Adapting means re-deciding the layout for each shape. You keep the hierarchy and the relationships, and you recompute the positions.
Scale, reflow, or redesign
Three strategies cover most cases.
| Strategy | What it does | Use when |
|---|---|---|
| Scale | Enlarges or shrinks everything proportionally | The aspect ratio is nearly the same, such as 1920×1080 to 1280×720 |
| Reflow | Keeps the elements and rearranges them in a new grid | The width changes but the content stays the same, such as desktop to tablet |
| Redesign (art direction) | Uses a different crop, a different text zone, or a different image | The aspect ratio changes a lot, such as 16:9 to 9:16 |
Most real work combines the last two. Scaling alone fails quickly because the type gets too small before the image does.
Keep the hierarchy, not the positions
Before you adapt, write down what must survive: the order in which the reader should notice the headline, the focal point, and the supporting text. Positions are allowed to change. The order is not.
For example, a landscape poster might put the headline top left and the subject at right. In a vertical story format, the same hierarchy can place the subject in the upper half and the headline in the lower half. The reading order is still image first, then headline, then details, but the arrangement is different.
Re-check the focal point and crop
Each new format needs its own crop. Start from the focal point you identified earlier. Draw the new frame so that point stays inside it, with room for text.
On the web, two properties control this:
object-fit: coverfills the frame and trims the overflow.object-positionchooses which part of the image stays visible when trimming happens.
A wide image whose subject sits at the right edge will lose the subject on a narrow screen unless you move the anchor.
.hero {
position: relative;
min-height: 24rem;
display: flex;
flex-direction: column;
justify-content: flex-end;
padding: 2rem;
color: #fff;
background:
linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0) 60%),
url("coast.jpg") 75% center / cover no-repeat;
}
@media (max-width: 600px) {
.hero {
min-height: 32rem;
padding: 1.25rem;
background:
linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0) 70%),
url("coast.jpg") 85% center / cover no-repeat;
}
}The narrow version makes the box taller, shifts the anchor toward the subject, and strengthens the scrim. The taller box matters because a portrait-shaped box gives the text more vertical room. The stronger scrim matters because a narrow screen wraps the headline onto more lines, so the text covers more of the photo.
Art direction with different image files
Sometimes a CSS crop is not enough, and you need a separately cropped file. The picture element lets the browser pick a source by viewport width.
<picture>
<source media="(max-width: 600px)" srcset="coast-portrait.jpg">
<source media="(max-width: 1024px)" srcset="coast-square.jpg">
<img src="coast-wide.jpg" alt="Fishing boats moored in a harbor at dawn">
</picture>The alt text lives on the img element and applies to every source. Write crops that show the same content, so one description stays true. If a crop removes something the alt text mentions, rewrite the alt text or choose a different crop.
Reflow the grid
A grid also changes between screens. A common pattern is 12 columns on desktop, 8 on tablet, and 4 on phones. Margins and gutters shrink with the width, but they should stay consistent within each size.
.layout {
display: grid;
gap: 1.5rem;
padding: 0 2rem;
grid-template-columns: repeat(12, 1fr);
}
.layout .text { grid-column: 1 / span 5; }
.layout .image { grid-column: 6 / span 7; }
@media (max-width: 900px) {
.layout { grid-template-columns: repeat(8, 1fr); padding: 0 1.5rem; }
.layout .text { grid-column: 1 / span 8; }
.layout .image { grid-column: 1 / span 8; grid-row: 1; }
}
@media (max-width: 600px) {
.layout { grid-template-columns: repeat(4, 1fr); gap: 1rem; padding: 0 1rem; }
}On narrow screens the image moves above the text with grid-row: 1. This puts the image first in the layout, which suits a photo-led page. If the text should come first, remove that rule.
Scale type with limits
Type should not scale in direct proportion to the screen. Fixed sizes at each breakpoint are predictable, and fluid sizes are smoother. The CSS clamp() function gives you fluid sizing with a floor and a ceiling.
h1 {
font-size: clamp(1.75rem, 1.2rem + 2.5vw, 3.5rem);
line-height: 1.1;
}
p {
font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
line-height: 1.5;
max-width: 65ch;
}Check two limits when you do this. The body text should not fall under about 16 px on a phone. The line length should stay near 45 to 75 characters, so on wide screens use max-width instead of letting lines run across the whole viewport.
Formats outside the browser
Social and print formats add their own constraints.
- Safe zones. Story and short-video formats (9:16) cover the top and bottom of the frame with app interface elements. Keep headlines and logos away from those edges, and check each platform's current guidance for exact margins.
- Crop by platform. A 4:5 feed image may be shown as a 1:1 or 3:4 thumbnail in a profile grid. Keep the subject and key words near the center.
- Print bleed. Print pieces need artwork extending past the trim edge, usually about 3 mm, with text kept inside a safe margin.
Build one master file with guides for each target format. Move the type layer, not the photo alone, as the format changes.
Common errors
- Hiding the subject.
object-fit: coverwith a centered anchor cuts off off-center subjects. Setobject-position. - Shrinking everything equally. Photos can shrink and still work. Type cannot go under a readable size.
- Reusing the desktop scrim. More text lines on a narrow screen cover more of the photo, so the scrim usually needs to extend higher or get darker.
- Testing only at breakpoints. Layouts break between breakpoints. Drag the window width slowly and look for awkward line breaks.
- Trusting emulators alone. Phone browsers have toolbars that change the visible height. Check on a real device.
Review checklist
- The hierarchy order is the same in every format.
- The focal point is visible and the text zone is clear in each crop.
- Margins and gutters are consistent within each size.
- Body text is at least 16 px on phones, and lines stay within about 75 characters.
- Contrast still passes with the new text position and the new scrim.
- Alt text still matches every crop.
Exercise
A landscape hero image has its subject at the right edge, and the headline sits over the left side. On a 360 px wide phone, the subject is cut off and the headline wraps to five lines over the photo. Name three changes you would make.
Show answer
(1) Change the crop or object-position (or use a picture source with a portrait crop) so the subject stays in the frame. (2) Make the hero taller and place the headline in a clear area, such as the lower part, so five lines have room. (3) Strengthen the scrim behind the text, extending it higher, and reduce the headline size with clamp() so it stays above a readable minimum. Then check contrast and alt text again.
Exercise
Why is font-size: 5vw a poor choice for body text across all screen sizes?
Show answer
Text size then follows the viewport width directly, so it becomes too small on phones (under 16 px at widths below 320 px) and too large on wide monitors. clamp() with a minimum and maximum keeps the size within a readable range while still scaling smoothly.