CSS Clamp Function

preview_player
Показать описание
✨ clamp() is a new function in CSS which provides a concise way for combining both the min() and max() functions

In this example I have a parent container whose width is automated from 100px to 500px.

There is a child container whose width is defined through the clamp function. We can see that the width stays between the bounds 100px and 200px.

⚠️ Note: the same can be achieved like this also

min(100px, max(50%, 200px))

#css #csstricks #coding #programming #frontend #webdesign #webdevelopment #html #reactjs #vuejs #fullstack #javascript
Рекомендации по теме
Комментарии
Автор

Idk how to program but this is fantastic

mk