I am trying to change the background color for the whole page in Angular(would use body, or html tag when working without framework). and I can't find the best practice for this, I want it to be within the framework if possible since I am building an application for years to come.
To add background color in HTML, use the CSS background-color property. Set it to the color name or code you want and place it inside a style attribute. Then add this style attribute to an HTML element, like a table, heading, div, or span tag.
To set the background color using jQuery, use the jQuery css() property. We will set background color on mouse hover with the jQuery on() method.
If you are using angular-cli.
There should exist a global style file.
In there you should be able to put your style e.g. html { background-color: black; }
to effect the whole page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With