Use rgb function to set the color : rgb « Style Basics « HTML / CSS






Use rgb function to set the color

 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Chapter Five</title>
<style type="text/css">
body {
    margin: 20px;
    color: black;
}
h1 {
    color: #663366;
}
h2 {
    color: #c9c;
}
ul {
    color: rgb(051, 051, 102);
}
hr {
    color: rgb(0%, 50%, 100%);
}
</style>
</head>
<body>
<h1>color my world</h1>
<h2>gender and color</h2>
<p>following:</p>
<ul>
<li>B</li>
<li>M</li>
<li>M</li>
<li>W</li>
</ul>
<p>this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. 
</p>
<hr />
</body>
</html>

 








Related examples in the same category

1.rgb color
2.rgb color with percentage
3.background-color: rgb(128, 128, 128)
4.background-color: rgb(50%, 50%, 50%)
5.border: thin solid rgb(0, 0, 0)