CSS min() Function
- Página anterior Función max() de CSS
- Página siguiente Función minmax() de CSS
- Volver a la capa superior Manual de funciones CSS
Definition and Usage
CSS min()
The function will select the smallest value from the comma-separated values list as the attribute value.
Tip:You can set min()
The function is considered to be used to set the maximum limit value of the element.
Example
Use min()
Set the width of #div1 to a maximum of 300px, but if the viewport width is less than 600px, the width will be smaller (50%):
#div1 { background-color: yellow; height: 80px; width: min(50%, 300px); }
CSS Syntax
min(value1, value2, ...)
Value | Description |
---|---|
value1, value2, ... | Required. A list of comma-separated values, from which the smallest value is selected. |
Technical Details
Version: | CSS Values and Units Module Level 4 |
---|
Browser Support
The numbers in the table represent the browser version that first fully supports this function.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
79 | 79 | 75 | 11.1 | 66 |
Páginas relacionadas
Referencias:Función max() de CSS
Tutoriales:Funciones matemáticas de CSS
- Página anterior Función max() de CSS
- Página siguiente Función minmax() de CSS
- Volver a la capa superior Manual de funciones CSS