Next, you'll add the CSS for your web app's stylesheet.
Copy this CSS, and paste it into a blank CSS file named style.css
:
As you can see, this CSS has style declarations for 4 types of elements in your HTML:
The CSS for body
styles the <body>
section in your HTML.
The CSS for .card
styles elements in your HTML that have class="card"
. The <div>
element has this class.
The CSS for .light-on
styles any elements in your HTML that have class="light-on"
. Currently, no elements have this class. However, your web app JS will add this class to the <div>
element if your light is turned on (changing the card's background color to yellow) and will remove this class if your light is turned off (changing the card's background color back to gray).
The CSS for button
styles the <button>
element in your HTML.
CSS: If you want to learn more about CSS or need a quick reference, check out the W3Schools CSS Tutorial and Reference.
If you preview the web app at this point, you can see how the CSS has changed the appearance of the web app, but it still doesn't function yet (because there's still no JS in the code.js
file).