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