Just keep in mind, the usage of style attribute overrides any style set globally. If you want it on one page, or just certain styling, you'd put the CSS in the coding. If you want the CSS to control all pages, yes, you'd put it into its own file with CSS as the file extension. What is the correct HTML for adding a background color? Find or insert the tags. How to set default background color for JTextPane in Java? Make sure you test any changes to your website before publishing them online. Bad question. To set the background color in HTML, use the style attribute. You can play around with the "left" and "right" tags to experiment with different directions for your gradient. Choose the correct HTML tag for the smallest size heading? It will override any style set in the HTML