Display:block; why with width auto it will not collapse only as wide as the content?

If an element is set to display: block; and has no width specified (or width: auto; ) it will collapse only as wide as the content inside of it. Why this statement is false? Can you explain to me?

hi @fadime

as far that i know, the display block element will stretched if they nested in body element.
but i found it different when i set the parent element to position fixed i.e nav parent element set to fixed and the links set to display block, the links does not stretch

1 Like