CSS oder nicht
bearbeitet von
@@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()`](https://developer.mozilla.org/de/docs/Web/CSS/min), [`max()`](https://developer.mozilla.org/de/docs/Web/CSS/max) und [`clamp()`](https://developer.mozilla.org/de/docs/Web/CSS/clamp) verwenden.
Was in einigen Fällen (looking at you, flexbox) aber nicht dasselbe tut. In [diesen Beispiel](https://codepen.io/gunnarbittersmann/pen/empYXPv?editors=0010) hab ich
```css
audio, video {
width: 16em;
max-width: 100%;
}
```
weil
```css
audio, video {
width: min(16em, 100%);
}
```
nicht geht.
🖖 Live long and prosper
{:@en}
--
*“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.”*{:@en}
— Bruce Springsteen, Manchester 2025-05-14
CSS oder nicht
bearbeitet von
@@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()`](https://developer.mozilla.org/de/docs/Web/CSS/min), [`max()`](https://developer.mozilla.org/de/docs/Web/CSS/max) und [`clamp()`](https://developer.mozilla.org/de/docs/Web/CSS/clamp) verwenden.
Was in einigen Fällen (looking at you, flexbox) aber nicht dasselbe tut. In [diesen Beispiel](https://codepen.io/gunnarbittersmann/pen/QwjwrLj?editors=0100) hab ich
```css
audio, video {
width: 16em;
max-width: 100%;
}
```
weil
```css
audio, video {
width: min(16em, 100%);
}
```
nicht geht.
🖖 Live long and prosper
{:@en}
--
*“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.”*{:@en}
— Bruce Springsteen, Manchester 2025-05-14