Sub topic 12
Wrapping Text Around Images and Shapes
This chapter assumes you can set type in a design tool such as InDesign or Figma. It also assumes you know basic CSS (selectors, float, units) and have read the earlier chapters on grids, cropping, and captions. Here you will learn when text wrap suits a layout, how to set it in print tools and on the web, and which defects to look for.
What text wrap does
Text wrap makes lines of type flow around an image instead of stopping above or below it. The text and the picture then read as one block, which suits editorial layouts such as magazine features and long-form articles.
Wrap works best when three conditions hold:
- The text is a long run of body copy, not a headline or a short label.
- The image is a secondary element that illustrates the text. It is not the focal point of the page.
- The column is wide enough that the wrapped lines still have a comfortable length.
If the image is the hero of the page, use a layout that gives it room instead. Placing text over an image or using negative space (covered in earlier chapters) is usually the better choice.
Choosing a wrap type
There are three common wrap shapes. Pick the simplest one that looks right.
| Wrap type | Text follows | Best for | Risk |
|---|---|---|---|
| Rectangular (bounding box) | The image's rectangular frame | Photos with a clean edge, grid-based layouts | Looks stiff if the subject is irregular |
| Contour (object shape) | The visible outline of the subject | Cut-out figures, product shots, objects on transparent backgrounds | Ragged, uneven lines if the outline is complex |
| Geometric shape (circle, polygon) | A shape you define, independent of the picture | Round portraits, deliberate design shapes | The shape and the image can drift out of sync |
Wrapping in design tools
Print and layout tools have built-in wrap controls.
- InDesign has a Text Wrap panel with modes for no wrap, wrapping around the bounding box, wrapping around the object shape, jumping over the object, and jumping to the next column. Each mode has an offset value for the gap between text and image.
- Illustrator offers Object > Text Wrap > Make, with a single offset value. The wrap applies to area type that sits behind the wrapping object in the stacking order.
- Photoshop has no wrap for body text. For shaped text, draw a path and set type inside it as a text area.
- Figma has no automatic text wrap. To flow text around an image, you split the copy into separate text boxes and size each one by hand. Treat this as a layout decision made early, because later edits to the copy force you to re-split the text.
For contour wraps in InDesign, the image needs a clipping path or an alpha channel (transparency) so the tool can detect the subject's edge. Without one, the tool wraps the full rectangle.
Set the offset deliberately
The offset is the clear space between the image and the text. Too small and the type looks crowded against the edge. Too large and the image seems detached from its text. A good starting point is one line of leading, or the same gutter width your grid uses. Use the same offset on every wrapped image in a document so the page feels consistent.
Wrapping on the web with CSS
On the web, wrap comes from floats. A floated element moves to one side and the following inline content flows around it. By default the wrap follows the element's rectangular box.
To wrap along a curve, add shape-outside. This example crops an image to a circle and makes the text follow the curve:
.portrait {
float: left;
width: 12rem;
height: 12rem;
margin: 0 1.5rem 1rem 0;
border-radius: 50%;
object-fit: cover;
shape-outside: circle(50%);
}Here is a minimal page that uses it. Save it with any square-ish portrait.jpg next to it:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Wrapped portrait</title>
<style>
body { max-width: 40rem; margin: 2rem auto; font: 1.125rem/1.6 Georgia, serif; }
.portrait {
float: left;
width: 12rem;
height: 12rem;
margin: 0 1.5rem 1rem 0;
border-radius: 50%;
object-fit: cover;
shape-outside: circle(50%);
}
</style>
</head>
<body>
<img class="portrait" src="portrait.jpg" alt="Portrait of the author smiling">
<p>Text placed after the floated image flows around its circular edge. Add enough copy that several lines pass beside the image, so the curve is visible in the left edge of the paragraph.</p>
<p>A second paragraph continues to wrap until the text passes the bottom of the image, then returns to the full column width.</p>
</body>
</html>Rules that cause most CSS wrap problems
shape-outsideonly works on floated elements. On a non-floated image it has no effect.border-radiuschanges only how the image is painted. It does not change the wrap area. You need bothborder-radiusandshape-outside, and the two shapes should match.- The element needs a defined size. Percentage values such as
circle(50%)are measured against the element's box. shape-marginadds the gap between the shape and the text. Use it instead of a margin when you want the gap to follow the curve.- If you use an image's own transparency as the shape (
shape-outside: url(cutout.png)), the file must be served from the same origin or with CORS headers. Pixels with alpha aboveshape-image-threshold(default 0) count as part of the shape.
The shape functions available are circle(), ellipse(), inset(), and polygon(). Use polygon() with a list of points for angular cut-outs.
Defects to check for
Text wrap creates specific typographic problems. Check each wrapped block for them.
- Narrow slivers. When the gap beside the image is only two or three words wide, line breaks become unpredictable and spacing gets uneven. Keep at least about 25 to 30 characters per wrapped line, or switch to a stacked layout.
- Rivers and gaps. Justified text in narrow wrapped lines opens wide word spaces. Use left-aligned text with a ragged right edge, or turn on hyphenation (
hyphens: autoin CSS, with alangattribute set). - Jagged rag. A contour wrap on a complex outline produces a ragged edge on the near side of the text. Simplify the path, increase the offset, or fall back to a rectangular wrap.
- Orphaned lines. A single line stranded beside the image, or a heading pushed down by a float, looks accidental. Adjust the image size or the copy.
- Text running through the image. After the copy changes, a wrap can fail. Always recheck after edits.
- Alignment to the grid. Align the top of the image with the cap height or x-height of the first line, and the bottom with a baseline. This keeps the wrapped block tied to the grid.
Keeping the caption with the image
A wrapped image often needs a caption. Use a figure so the image and caption move together, then float the figure rather than the image:
<figure>
<img src="harbor.jpg" alt="Fishing boats moored in a harbor at dawn">
<figcaption>Harbor at dawn, 6:10 a.m.</figcaption>
</figure>Float figure, not img, in your CSS. A circular shape-outside then needs to account for the caption height, so for captioned figures a rectangular wrap is usually safer. Alt text describes the image for readers who cannot see it. The caption adds information for everyone.
Exercise
A CSS page has a photo with border-radius: 50% and float: left, but the paragraph text still wraps around a square box. What is missing, and what else should you set so the gap follows the curve?
Show answer
The image needs shape-outside: circle(50%), because border-radius only changes how the image is painted, not the wrap area. Add shape-margin (for example 1rem) so the gap between the curve and the text follows the shape, and make sure the image has an explicit width and height.
Exercise
You are laying out an article in Figma, which has no automatic text wrap. A designer proposes a contour wrap around a cut-out figure with 18 lines of copy. Name two problems this plan creates and one alternative.
Show answer
The copy must be split into separate text boxes by hand, so every edit forces a re-split, and a complex contour will produce ragged, uneven line lengths that you must adjust line by line. An alternative is a simple rectangular arrangement, with the image in one grid column and the text in the adjacent column, which keeps edits easy and line lengths consistent.