fit-content and Firefox

87 views
Skip to first unread message

Andrew Poulos

unread,
Mar 12, 2021, 1:24:01 AM3/12/21
to
This page
<https://developer.mozilla.org/en-US/docs/Web/CSS/fit-content>
claims that Firefox fully supports fit-content.

CanIUse says it doesn't:
<https://developer.mozilla.org/en-US/docs/Web/CSS/fit-content>

And Dev Tools in Firefox 87 says that "height: fit-content;" has an
invalid property value.

I have a parent DIV that contains a number of vertically aligned DIVs.
The parent DIV is a relatively positioned element, It has "display:
flex;" and is a item in a grid.

I run some calculations on the parent DIV so I need it's height to match
the overall height of the nested DIVs. How can I get the two to match?

Andrew Poulos

Andrew Poulos

unread,
Mar 12, 2021, 1:38:42 AM3/12/21
to
Dr DuckDuckGo (DDDG) suggested I use -moz-fit-content and that seems to
get Firefox to behave as other browsers using fit-content.

Andrew Poulos

James Kirk

unread,
Mar 12, 2021, 10:48:30 AM3/12/21
to
In Message: <POCdnZ6c27v2kdb9...@westnet.com.au>
Andrew Poulos <ap_...@hotmail.com> wrote:

> On 12/03/2021 5:23 pm, Andrew Poulos wrote:

>> This page
>> <https://developer.mozilla.org/en-US/docs/Web/CSS/fit-content>
>> claims that Firefox fully supports fit-content.

https://developer.mozilla.org/en-US/docs/Web/CSS/fit-content#browser_compatibility
click on 3₋ₓ₋ ▼ would reveal the following

prefix Implemented with the vendor prefix: -moz-
https://caniuse.com/mdn-css_properties_width_fit-content

the yellow background - indicates support with preix … hover over or
click on browser will produce a popup revealing more support info

accessibility issue perhaps

[snip]

> Dr DuckDuckGo (DDDG) suggested I use -moz-fit-content and that seems
> to get Firefox to behave as other browsers using fit-content.

The information was there on MDN and CanIUse … just over looked and
hidden.

--
J𝕒𝕞𝕖𝕤 𝕂𝕚𝕣𝕜


Andrew Poulos

unread,
Mar 14, 2021, 5:07:18 PM3/14/21
to
On 13/03/2021 2:48 am, James Kirk wrote:
> In Message: <POCdnZ6c27v2kdb9...@westnet.com.au>
> Andrew Poulos <ap_...@hotmail.com> wrote:
>
>> On 12/03/2021 5:23 pm, Andrew Poulos wrote:
>
>>> This page
>>> <https://developer.mozilla.org/en-US/docs/Web/CSS/fit-content>
>>> claims that Firefox fully supports fit-content.
>
> https://developer.mozilla.org/en-US/docs/Web/CSS/fit-content#browser_compatibility
> click on 3₋ₓ₋ ▼ would reveal the following

Oh, this is the first time I've ever clicked the down arrow.

> prefix Implemented with the vendor prefix: -moz-
>
>
>>> CanIUse says it doesn't:
>>> <https://developer.mozilla.org/en-US/docs/Web/CSS/fit-content>
>
> https://caniuse.com/mdn-css_properties_width_fit-content
>
> the yellow background - indicates support with preix … hover over or
> click on browser will produce a popup revealing more support info

On my computer the background colour is green (indicating 'full
support') but I now realise what the little square with the dash in it
means there's some relevant information available on hover.

> accessibility issue perhaps
>
> [snip]
>
>> Dr DuckDuckGo (DDDG) suggested I use -moz-fit-content and that seems
>> to get Firefox to behave as other browsers using fit-content.
>
> The information was there on MDN and CanIUse … just over looked and
> hidden.

Yes, I missed it both times.

Andrew Poulos

Reply all
Reply to author
Forward
0 new messages