width: fit-content css w3schools code example Example: css div width fit content display: inline-block;