Inline Layout without Browser Hacks
suggest changeinline-block works without the old zoom and star-property hacks. For a component that needs internal alignment, inline-flex or inline-grid is often more expressive:
.tag {
display: inline-flex;
align-items: center;
gap: 0.375rem;
padding: 0.25rem 0.625rem;
border-radius: 999px;
}
The component participates in surrounding text as an inline-level box while arranging its children with Flexbox.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents