Let’s begin the fascinating journey of discovering colors starting with the background of a web page. For the background of a page, you can also use images, although I am quite opposed to this type of usage, but we will eventually see later how to use them.
Before looking at the color settings of a web page, it is important to choose a light color and now I’ll explain why: since the text must necessarily be dark to be readable without difficulty, if you choose a dark background color, reading the content will become a daunting task, so let’s use a light color, the lightest possible. Now I’ll show you an example of what I mean:
|
How do you read this text? |
How do you read this text? |
The cell on the left is practically unreadable while the one on the right has clear and readable text. Is the concept clear? Keep this rule in mind especially if you use pages with a lot of text. Good, now let’s go back to our background. In the lesson dedicated to Colors, you can view the Hexadecimal Codes table and choose a color for your background. Let’s take for example the color ccff99….wow, I think I forgot something in this code….what do you think? Oh yes, the hashtag #
So here is the correct code we will use: #ccff99.
Now I present to you the tag background-color which together with the body tag serves to determine the background color of a web page. As an abbreviation, however, the command bgcolor is used which has the same effect.
Previously, we analyzed the body tag which was written like this. Now, let’s combine these two tags to set our color: bgcolor=”#cff99″> Insert it into your index.html page and save the changes by overwriting. In the lesson dedicated to Colors, the table of the 16 colors recognized by all web browsers is shown.
If for the background of our site we use one of these 16 colors, for example Navy in the body tag we can also write it this way:
bgcolor="Navy">
If instead we use colors outside of this table, it is necessary to specify the Hexadecimal Code. Basically, with this command, we have ordered the body “Hey body, pay attention… set the background color to #ccff99, ok?” This way, the entire background of our page will be set and displayed with this color.
Pubblicato in HTML & CSS
Be the first to comment