Gunnar Bittersmann: CSS oder nicht

Beitrag lesen

@@Ryuno-Ki

Prinzipiell tendiere ich zu min-width und max-width, um eher Grenzen festzusetzen, in denen der Web-Browser Elemente layouten darf.

Dafür kann man auch die Funktionen min(), max() und clamp() verwenden.

Was in einigen Fällen (looking at you, flexbox) aber nicht dasselbe tut. In diesen Beispiel hab ich

audio, video {
	width: 16em;
	max-width: 100%;
}

weil

audio, video {
	width: min(16em, 100%);
}

nicht geht (für Viewpotbreiten zwischen 513px und 565px bei Standard-Browsereinstellungen).

🖖 Live long and prosper

--
“In my home, the America I love, the America I've written about, that has been a beacon of hope and liberty for 250 years, is currently in the hands of a corrupt, incompetent and treasonous administration. Tonight, we ask all who believe in democracy and the best of our American spirit, to rise with us, raise your voices against authoritarianism, and let freedom reign.”
— Bruce Springsteen, Manchester 2025-05-14