Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Learn More

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

  • 5 trả lời
  • 1 gặp vấn đề này
  • 27 lượt xem
  • Trả lời mới nhất được viết bởi 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.

Tất cả các câu trả lời (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.

Được chỉnh sửa bởi lildew2 vào

more options

Được chỉnh sửa bởi cor-el vào

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