QuoteGenerator: Why is the background-color property not working?


#1

Here is my codepen, of my question: https://codepen.io/Ag_Yog/pen/rzezYw.

I wrote the following code in an attempt to make the white space a different color:
html, body {
width: 100%;
height: 100%;
background-color: #00e676 ;
}

I am confused on why this doesn’t work, as I specified the dimensions of the body.

Also, the JavaScript portion of my code which generates the new quote doesn’t work on codepen, even though the same code worked on notepad.

Thanks for any help


#2

In Codepen, if you place your CSS resources in the HTML panel, they will load after your CSS in the CSS panel. So, bootstrap’s settings for <body> are overriding yours currently:

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.42857143;
  color: #333;
  background-color: #fff;
}

Move your <head> content to your settings (Settings -> HTML -> Stuff for <head>) in Codepen and you will get the background color you’ve specified in your CSS.