Rechercher dans l’assistance

Évitez les escroqueries à l’assistance. Nous ne vous demanderons jamais d’appeler ou d’envoyer un SMS à un numéro de téléphone ou de partager des informations personnelles. Veuillez signaler toute activité suspecte en utilisant l’option « Signaler un abus ».

Learn More

Why doesn't FireFox support the fit-content value for height in CSS?

  • 5 réponses
  • 1 a ce problème
  • 27 vues
  • Dernière réponse par cor-el

more options

I have tried to use the fit-content value and it won't work in FireFox for height but works in Chrome. I've even used -moz-fit-content. I understand that it is said to be experimental.

I have tried to use the fit-content value and it won't work in FireFox for height but works in Chrome. I've even used -moz-fit-content. I understand that it is said to be experimental.

Toutes les réponses (5)

more options

Did you check layout.css.grid.enabled on the about:config page to see if it is true?

See:

If you use a Firefox version from the repositories then that version may behave differently.

more options

It is set to true but I am not trying to use that function. What I am looking to do is this: .element {

     height: fit-content;

} This method works on Chrome very nicely but FireFox does not seem to support it. I've also tried -moz-fit-content. This value for height is mentioned at https://developer.mozilla.org/en-US/docs/Web/CSS/height The article shows no support for it on height but it seems there is support for width.

Modifié le par lildew2

more options

Modifié le par cor-el

more options

Interesting. This solution - .element {

    height: -moz-fit-content;

} - is not working for me. Am I doing something wrong? I have tried it on two machines and neither work in FireFox but work in Chrome.

more options

It looks that this still needs to be implemented for height.

  • bug 567039 - support min-content, max-content, fit-content, and fill for height/min-height/max-height too

Please do not comment in bug reports
https://bugzilla.mozilla.org/page.cgi?id=etiquette.html