Search code examples
csswidth

In CSS how can I use the max between 100% and max-content


So i need to always have my width to 100%, except when max-content is longer.

width: max(100%, max-content);

Something like that but isn't working


Solution

  • You can try this

    width : max-content;
    min-width: 100%;