<?xml version="1.0" encoding="utf-8"?>

CSS keyword values

CSS keyword values

Keyword values leave it to the browser to decide how to size the content area. The most common keyword values are:

max-content sets the intrinsic preferred width or height. For example, adding a declaration width: max-content; will set the length of the element to the length of the longest line.

min-content sets the intrinsic minimum width or height. A paragraph with the declaration width: min-content; will have the width of the longest word.

fit-content allows the element to use all available space but never less than the min-content and never more than the max-content.

auto lets the browser calculate and select a width for the specified element.

Improve your UX & Product skills with interactive courses that actually work