Sub topic 3
Scrims, Gradients, and Overlays for Readable Text
Assume you already know basic type sizes, font weights, color, and image resolution. This chapter focuses on making type and images work together across formats.
Scrims, Gradients, and Overlays for Readable Text
A scrim is a translucent color layer placed between an image and text. It reduces detail and increases contrast. A gradient scrim is strongest where the text sits, so it preserves more of the image elsewhere.
.hero {
min-height: 24rem;
padding: 2rem;
display: flex;
flex-direction: column;
justify-content: flex-end;
color: #fff;
background:
linear-gradient(to top, rgb(0 0 0 / 0.75), rgb(0 0 0 / 0) 65%),
url("coast.jpg") center / cover no-repeat;
}Check the text at its smallest intended size. If the image remains distracting, strengthen the scrim, move the text, or choose a quieter crop.
Wrapping Text Around Images and Shapes
For editorial layouts, text can wrap around an image rather than stop at a rectangular boundary. A circular image can use shape-outside:
.portrait {
float: left;
width: 12rem;
height: 12rem;
margin: 0 1.5rem 1rem 0;
border-radius: 50%;
object-fit: cover;
shape-outside: circle(50%);
}Use wrapping sparingly. Short lines or irregular gaps can make paragraphs difficult to read.
Captions, Credits, and Image-Text Pairing
Keep an image and its caption together with a figure. The caption identifies or explains the image. A credit names its source when required.
<figure>
<img src="harbor.jpg" alt="Fishing boats moored in a harbor at dawn">
<figcaption>Harbor at dawn, 6:10 a.m. Photo: A. Rivera.</figcaption>
</figure>Adapting Layouts to Other Formats and Screens
Test portrait, landscape, and narrow mobile versions. Reposition the focal point, shorten the headline, or move text below the image when the original text zone disappears. Keep margins and alignment consistent rather than scaling every element blindly.
Accessibility: Contrast Checks and Alternative Text
Check text-to-background contrast, especially over detailed photographs. A scrim helps, but it does not replace testing. Alternative text should describe the image's useful content, not its file name. Decorative images can use empty alternative text.
Resolution, Formats, and Export
Export raster images at the required display density. Use JPEG for photographs, PNG for transparency, and SVG for scalable illustrations when supported. Inspect the exported file at its final size for blur, compression artifacts, and unexpected cropping.
Reviewing and Refining the Finished Layout
Review the hierarchy from a distance. Ask whether the eye reaches the intended headline, whether the image supports the message, and whether captions belong visually to their images. Remove any overlay that hides important image content.
Exercise
The headline becomes unreadable over a bright part of the photo. What should you try first?
Show answer
Move the text into a quieter area or strengthen a localized gradient scrim, then recheck contrast.