Kevin Powell - CommunityKP-C
Kevin Powell - Communityβ€’15mo agoβ€’
46 replies
LachsDuJour

When text gets in two lines

I am always running into this problem.
Lets say i have a button which is display: inline-block (or flex, or inline-flex) and max-width: fit-content;
As long as the inner text does not break into two lines it looks good. The width of the button is defined by its text. When the text breaks in two lines the button gets width 100%. I want it to fit the content. Any ideas what to do? I cannot use max-width because its a cms and i dont know what text will be inside.
Was this page helpful?