3 ms·
But the css default is that a container expand to contain the content without overflow or cropping. An effect like in the logo only happens if you set an expli
by bazoom42 3y ago
But the css default is that a container expand to contain the content without overflow or cropping.
An effect like in the logo only happens if you set an explicit width which is less than the longest word.
- fiddlerwoaroof 3y agoI think it would be less surprising if you had to opt-into text overflowing the border-box: the current behavior is like the behavior of floats, which always ended up being something you spent a lot of time working around.
- bazoom42 3y agoWhat would be a better default then? Scroll or crop? Breaking the word? Neither are great. By using “width” you are explicitly opting out of the default “expand to fit”.
- fiddlerwoaroof 3y agoIf I say `width: 32px`, I want the width to be 32px, cropped, because that's what I asked for. This is really a question of what the default value of the `overflow` property should be.
- bazoom42 3y agoOk, I would disagree that cropping is the best default. The overflow effect is typically unintended (eg. the new design was never tested with the German translation), but at least you can read the text if it happens. Silently hiding content would be way worse for the user IMHO. You might deliberately want to crop text to get some particular visual effect, but I cant see why you would want it to be the default for all text. The issue is you are putting a bigger box inside a smaller box. There is no perfect way to solve this, but css defaults to respecting the specified sizes by letting the inner box overflow the edge of the outer box. Seems reasonable to me, and you can get scaling or scrolling or cropping instead if you specify so.