![]() within a style tag in the head tag (internal styling),.within your HTML tags (inline styling),.This property works like every other CSS property, meaning you can make use of it to style your page in three ways: You can use the CSS background-color property to change the color of your web pages. In case you are in a rush to see how you can change the background color of your web page, divs, and other elements, then here it is: // Using inline CSS When dealing with styling, it is best to use CSS. ![]() This makes sense because HTML is a markup language, not a styling language. It’s now replaced by a better alternative, the CSS background-color property. However, this attribute was depreciated when HTML5 was introduced. In the past, before the introduction of HTML5, some basic styling was handled by HTML.įor example, when you wanted to change the background color of your page, you could've easily added the bgcolor attribute in the opening body tag and set it to the value of your preferred color. In this article, you will learn how to change the background color of your web pages with HTML and CSS. This help readers avoid harsh colors that can affect their eyes. You want your web page to be appealing to your users and not jarring to the eye.Īnd to help do that, you can choose background and text colors that blend well and complement each other.īy default, you will notice that your web page has a transparent background color, which you can change to any color you want.įor example, you might want to create a dark mode feature on your web page so that the background has a dark color while the text has a light color. When you're building web pages, you always want to create unique layouts.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |