RED component |
GREEN component |
BLUE component | SUM COLOR |
The background and the text color of your web page aren't elements releated
to the contents, but to the page style
It's a good practice to set this informations inside the STYLE tag
in the HEAD section.
The selector is the body and the properties are background-color and color.
<head> <style> body { background-color: value; color: value; } </style> </head> |
The color value is the color code.
Code | Output |
<head> <style> body { background-color:#000000; color:#FF0000; } </style> </head> |
|
<head> <style> body { background-color:#FF0000; color:#FFFFFF; } </style> </head> |
|
<head> <style> body { background-color:#00FF00; color:#0000FF; } </style> </head> |
|
<head> <style> body { background-color:#0000FF; color:#FFFFFF; } </style> </head> |
|
Note: Don't use the same color for the background and the text!!!
For mathematics people: Do you want to know more about hexadecimal numbers?
For everyone: Do you want to see more colors?
Do you hate the numbers? No problem!! Many colors have a simple name-color!
Code | Output |
<head> <style> body { background-color:cyan; color:red; } </style> </head> |
|
<head> <style> body { background-color:red; color:yellow; } </style> </head> |
|
<head> <style> body { background-color:violet; color:black; } </style> </head> |
|
<head> <style> body { background-color:purple; color:white; } </style> </head> |
|
<html> <head> <style> body { background-color: .....; color: .......;} </style> </head> <body> This is my first colored web page ......... </body> </html>