0

I am having a problem displaying a radial gradient on my website in Firefox. The gradient seems to work fine in Edge and Chrome but not Firefox.

In chrome and edge I get this:

In chrome and edge I get this

This is what I see in Firefox:

This is what I see in Firefox

body{
  background-color: blue;
  background: -moz-radial-gradient(center, ellipse cover, #0047ea 0%, #151515 100%);
  background: radial-gradient(#0047ea,#151515 );
  z-index: 0;
}
Mike 'Pomax' Kamermans
  • 49,297
  • 16
  • 112
  • 153

1 Answers1

1

You need to set a height on the body. Setting it to 100vh will make the gradient cover the screen.

body{
  background-color: blue;
  background: -moz-radial-gradient(center, ellipse cover, #0047ea 0%, #151515 100%);
  background: radial-gradient(#0047ea, #151515);
  z-index: 0;
  
  height: 100vh;
}
jhpratt
  • 6,841
  • 16
  • 40
  • 50
  • thanks that worked –  Jun 26 '18 at 04:36
  • @HenryOliver It looks like you're new to Stack Overflow. Decent first question! Just a reminder, if you haven't seen, you should accept the answer that helps you out. – jhpratt Jun 26 '18 at 04:37
  • I'm trying lol but for some reason I need to wait another minute –  Jun 26 '18 at 04:40
  • Oh, haha forgot there's a 15 minute wait limit. Just wasn't sure if you were aware of that functionality. It also gives you rep. – jhpratt Jun 26 '18 at 04:40
  • there we go marked as solved! thanks again for your help –  Jun 26 '18 at 04:42
  • @HenryOliver an easier fix is to simply add `html{height:100%}` ... you may refer to the duplicate question for more details – Temani Afif Jun 26 '18 at 07:42