Page 35 - Learn To Use HTML and CSS
P. 35
So You Want to Learn to Use HTML and CSS – Version 2020-06-12a Page 25
Chapter 2 — Adding Images, Media, Color, and Font Effects 40
written as numbers that range from 0 to 255, with 0 being none. For example, the color red
Free
would be written as rgb(255,0,0), meaning it has the maximum amount of red and no green
or blue. All 16,777,216 color combinations are possible using this method.
Here is an example of all three methods being used in an HTML document. In this example the
background is being specified with the background-color style.
eBook
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Chapter 2 - Colors</title>
</head>
Edition
<body style="background-color: #ffff00;">
<h1 style="background-color: blue; color: white;">My Colorful
Page</h1>
<p style="color:rgb(255,100,50);">Opanesat tocusan dis re retapih
vanohir! Der leminoy delisot ner ibopi menid goneg fo latato. Col
tagaci oge lorope idat secobe no. Necuti bacena naraset ceg
Please support this work at
ilebarop fecocief.</p>
</body>
</html>
http://syw2l.org
Free
eBook
Illustration 7: My Colorful Page
Edition
Notice in the line <h1 style="background-color: blue; color:
40 http://www.w3schools.com/cssref/css_colors.asp
Copyright 2020 — James M. Reneau PhD — http://www.syw2l.org — This work is
licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

