How to prevent a flex item from taking full width of container
16 November 2023 (Updated 20 May 2025)
Assuming your flex container’s flex-direction
is row
, you can apply the align-self: start
or align-self: end
property to prevent the flex item from taking the full width of its container.
Tagged:
CSS recipes
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment