HTML/CSS/Style Basics/rgb — различия между версиями

Материал из Web эксперт
Перейти к: навигация, поиск
м (1 версия)
 
(нет различий)

Текущая версия на 08:17, 26 мая 2010

background-color: rgb( 128)

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title> inch measurement </title>
        <style type="text/css" media="all">
            body {
          background-color: rgb(128, 128, 128);
      }
        </style>
    </head>
    <body>
    </body>
</html>



background-color: rgb(50%, 50%, 50%)

 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title> inch measurement </title>
        <style type="text/css" media="all">
            body {
          background-color: rgb(50%, 50%, 50%);
      }
        </style>
    </head>
    <body>
    </body>
</html>



border: thin solid rgb(

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title> exercise 4-2 </title>
        <style type="text/css" media="all">
            body {
                font-size: 12px;
            }
            h1 {
                font-size: 25px;
                background: rgb(255, 192, 203);
                padding: 25px;
                border: thin solid rgb(0, 0, 0);
            }
            p {
                font-size: 11px;
                padding: 11px;
                border: thin solid rgb(0, 0, 0);
                background: rgb(128, 128, 128);
                color: rgb(255, 255, 255);
            }
        </style>
    </head>
    <body>
        <h1>
            This is a heading
        </h1>
        <p>
            This is a paragraph of text.
        </p>
    </body>
</html>



rgb color

 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title> inch measurement </title>
        <style type="text/css" media="all">
            body {
          background-color: rgb(128, 128, 128);
      }
        </style>
    </head>
    <body>
    </body>
</html>



rgb color with percentage

 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title> inch measurement </title>
        <style type="text/css" media="all">
            body {
          background-color: rgb(50%, 50%, 50%);
      }
        </style>
    </head>
    <body>
    </body>
</html>



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>