Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

-moz-max-content custom implementation

Tags:

html

css

I have a ul and I want to fix the width of the ul to content. Currently I use -moz-max-content but there is some problem in non-mozilla browsers.

How can I implement the -moz-max-content?

like image 883
Afshin Mehrabani Avatar asked Jan 16 '23 11:01

Afshin Mehrabani


1 Answers

Use max-width: intrinsic;. This works for webkit browsers (Chrome & Safari).

Be aware that attributes starting with -moz are only working in Mozillas Firefox. The common prefixes are:

  • -moz for Firefox
  • -webkit for Webkit (mainly Chrome & Safari and a lot of the Chromium forks)
  • -ms for IE10
  • -o for Opera

As written at http://msdn.microsoft.com/library/ms530811.aspx you can only define pixels or percentage. The max-width property itself is supported since IE7.

It might be that you can use a max-width: 100%; for IE, but I'm unsure if the results are the same.

like image 153
Johannes Klauß Avatar answered Jan 19 '23 02:01

Johannes Klauß