CSS Clamp Function

Опубликовано: 02 Ноябрь 2024
на канале: CodeMentor
9,188
662

✨ 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