Shapes for Floats
suggest changeshape-outside changes the contour around which inline content wraps beside a float:
.portrait {
float: inline-start;
inline-size: 12rem;
aspect-ratio: 1;
object-fit: cover;
border-radius: 50%;
shape-outside: circle(50%);
shape-margin: 1rem;
margin-inline-end: 1rem;
}
Common values include circle(), ellipse(), inset(), polygon(), a box such as margin-box, or an image whose alpha channel defines the shape. The element must be floated for shape-outside to affect surrounding inline content.
shape-margin adds space around the shape, while shape-image-threshold controls which alpha values in an image count as part of the shape.
Use shapes for editorial text wrapping, not general component layout. Grid and Flexbox are more appropriate for columns and interface structure.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents