LachsDuJour
LachsDuJour
KPCKevin Powell - Community
Created by LachsDuJour on 11/4/2024 in #front-end
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.
47 replies