Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
more documentation, official support notice
Source Link
Adam Katz
  • 16.3k
  • 5
  • 80
  • 94

This solution does not rely on JavaScript being turned on.

@-moz-document url-prefix() { h1 { color: red; } }
<h1>This should be red in FF</h1>

It'sThis is based on yet another Mozilla-specific CSS extension. There's a whole list of these CSS extensions right here: Mozilla-specific CSS Extensionsextension. Like most of these, it is deprecated. However, this extension's deprecation has an exception specifically for browser detection. The Firefox note in ⚠ Do note that they are mostly deprecated!@document § browser compatibility states that Firefox 61+ "only supports an empty url-prefix() value, which is supported due to its use in Firefox browser detection. Still supported in user stylesheets."

For more information about this specific CSS extension, see this question: What does @-moz-document url-prefix() do?

This solution does not rely on JavaScript being turned on.

@-moz-document url-prefix() { h1 { color: red; } }
<h1>This should be red in FF</h1>

It's based on yet another Mozilla-specific CSS extension. There's a whole list of these CSS extensions right here: Mozilla CSS Extensions. ⚠ Do note that they are mostly deprecated!

For more information about this specific CSS extension, see this question: What does @-moz-document url-prefix() do?

This solution does not rely on JavaScript being turned on.

@-moz-document url-prefix() { h1 { color: red; } }
<h1>This should be red in FF</h1>

This is based on a Mozilla-specific CSS extension. Like most of these, it is deprecated. However, this extension's deprecation has an exception specifically for browser detection. The Firefox note in @document § browser compatibility states that Firefox 61+ "only supports an empty url-prefix() value, which is supported due to its use in Firefox browser detection. Still supported in user stylesheets."

For more information about this specific CSS extension, see What does @-moz-document url-prefix() do?

added 1 character in body
Source Link
Ionuț G. Stan
  • 179.5k
  • 19
  • 196
  • 206

This solution does not rely on JavaScript being turned on.

@-moz-document url-prefix() { h1 { color: red; } }
<h1>This should be red in FF</h1>

It's based on yet another Mozilla specific CSS-extensionspecific CSS extension. There's a whole list of these CSS extensions right here:

   Mozilla CSS Extensions. ⚠ Do note that they are mostly deprecated!

For more information about this specifspecific CSS-extension extension, see this question: What does @-moz-document url-prefix() do?

This solution does not rely on JavaScript being turned on.

@-moz-document url-prefix() { h1 { color: red; } }
<h1>This should be red in FF</h1>

It's based on yet another Mozilla specific CSS-extension. There's a whole list of these CSS extensions right here:

 Mozilla CSS Extensions. ⚠ Do note that they are mostly deprecated!

For more information about this specif CSS-extension, see this question: What does @-moz-document url-prefix() do?

This solution does not rely on JavaScript being turned on.

@-moz-document url-prefix() { h1 { color: red; } }
<h1>This should be red in FF</h1>

It's based on yet another Mozilla-specific CSS extension. There's a whole list of these CSS extensions right here:  Mozilla CSS Extensions. ⚠ Do note that they are mostly deprecated!

For more information about this specific CSS extension, see this question: What does @-moz-document url-prefix() do?

Removed social clutter; Added deprecation warning; Grammar; Added reference for @-moz-document url-prefix() as comments ask about it but it is another question.
Source Link

OK, I've found it. This is probably the cleanest and easiest solution out there and does not rely on JavaScript being turned on.

@-moz-document url-prefix() { h1 { color: red; } }
<h1>This should be red in FF</h1>

It's based on yet another Mozilla specific CSS extension-extension. There's a whole list forof these CSS extensions right here:   

Mozilla CSS Extensions. ⚠ Do note that they are mostly deprecated!

For more information about this specif CSS-extension, see this question: What does @-moz-document url-prefix() do?

OK, I've found it. This is probably the cleanest and easiest solution out there and does not rely on JavaScript being turned on.

@-moz-document url-prefix() { h1 { color: red; } }
<h1>This should be red in FF</h1>

It's based on yet another Mozilla specific CSS extension. There's a whole list for these CSS extensions right here:  Mozilla CSS Extensions.

This solution does not rely on JavaScript being turned on.

@-moz-document url-prefix() { h1 { color: red; } }
<h1>This should be red in FF</h1>

It's based on yet another Mozilla specific CSS-extension. There's a whole list of these CSS extensions right here: 

Mozilla CSS Extensions. ⚠ Do note that they are mostly deprecated!

For more information about this specif CSS-extension, see this question: What does @-moz-document url-prefix() do?

added 1 character in body
Source Link
Ionuț G. Stan
  • 179.5k
  • 19
  • 196
  • 206
Loading
deleted 7 characters in body
Source Link
VXp
  • 12.1k
  • 6
  • 34
  • 47
Loading
Updated link to MDN; made it an inline link
Source Link
Sumner Evans
  • 9.2k
  • 5
  • 32
  • 48
Loading
deleted 65 characters in body
Source Link
Ionuț G. Stan
  • 179.5k
  • 19
  • 196
  • 206
Loading
Source Link
Ionuț G. Stan
  • 179.5k
  • 19
  • 196
  • 206
Loading