CSS3 -ms-max-content in IE11

István picture István · Apr 3, 2014 · Viewed 50.7k times · Source

We can set in CSS3 -moz-max-content (for Firefox) and -webkit-max-content (for Chrome, Safari) as width, but it seems -ms-max-content is not working in Internet Explorer (IE11).

Update: Here is a sample code:

Answer

Sandra Alvarez picture Sandra Alvarez · Aug 23, 2019

This works on IE11, Chrome and Firefox

instead of

width: -moz-max-content;
width: -webkit-max-content;
width: -o-max-content;
width: -ms-max-content;

I used

width: auto;
white-space: nowrap;