HTML/CSS/CSS Attributes and Javascript Style Properties/color

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

color:black

   <source lang="html4strict">


<html>

 <head>
   <style>
     p.center {text-align:center;color:black;}
   </style>
   <title>Chapter Two, XHTML and CSS</title>
 </head>
 <body>

It is easy to use XHTML

 </body>

</html>

</source>
   
  


"color" Example

   <source lang="html4strict">
   

<html> <head> <style> .style1 {

  font-family:verdana; 
  color:purple 

} </style> </head> <body>

A color text.

</body> </html>


     </source>
   
  


color: lime

   <source lang="html4strict">


<html> <head> <title></title> <style type="text/css"> h1 {font-family: arial; color: navy;

   background-color: yellow;}

h1.red {font-family: "Times New Roman";

       color: red;
       background-color: black;}

h1.white {font-family: "Times New Roman";

         color: white;
         background-color: green}

h1.lime {font-family: arial;

        font-style: italic;
        color: lime;
        background-color: olive}

p.blackback {font-family: arial;

            font-style: italic;
            font-weight: bold;
            color: powderblue;
            background-color: black;}

p.yellowbk {background-color: yellow;

           font-size: 16pt}

p.red {font-weight: light;

      color: #ff0000;
      text-align: center;
      font-size: 32pt;}

</style> </head> <body>

basic headline.

red headline.

my white headline.

my lime headline.

a sample of the blackback style.

how yellowbk looks.

red, centered font.

An unmodified paragraph.

</body> </html>

</source>
   
  


color: rgb( 255)

   <source lang="html4strict">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html>

   <head>
       <title> </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>

This is a heading

This is a paragraph of text.

   </body>

</html>

</source>
   
  


Named colors

   <source lang="html4strict">

<HTML> <HEAD>

 <TITLE>A Chart of the Named Colors</TITLE>
 <STYLE TYPE="text/css">
 td  {
      font-size:1.2em; font-weight:500;
 }
 table {
    Text-Align : Center
 }
 td.wt {
    Color : white ;
    Font-Weight : 500
 }
 </STYLE>

</HEAD> <BODY BGCOLOR="black">

The Netscape Named Colors

 <P>
aliceblue antiquewhite aqua aquamarine
azure beige bisque blanchedalmond
blue blueviolet brown burlywood
cadetblue chartreuse chocolate coral
cornflowerblue cornsilk crimson cyan
darkblue darkcyan darkgoldenrod darkgray
darkgreen darkkhaki darkmagenta darkolivegreen
darkorange darkorchid darkred darksalmon
darkseagreen darkslateblue darkslategray darkturquoise
darkviolet deeppink deepskyblue dimgray
dodgerblue firebrick floralwhite forestgreen
fuchsia gainsboro ghostwhite gold
goldenrod gray green greenyellow
honeydew hotpink indianred indigo
ivory khaki lavender lavenderblush
lawngreen lemonchiffon lightblue lightcoral
lightcyan lightgoldenrodyellow lightgreen lightgrey
lightpink lightsalmon lightseagreen lightskyblue
lightslategray lightsteelblue lightyellow lime
limegreen linen magenta maroon
mediaumaquamarine mediumblue mediumorchid mediumpurple
mediumseagreen mediumslateblue mediumvioletred midnightblue
mintcream mistyrose moccasin navajowhite
navy oldlace olive olivedrab
orange orangered orchid palegoldenrod
palegreen paleturquoise palevioletred papayawhip
peachpuff peru pink plum
powderblue red rosybrown royalblue
saddlebrown salmon sandybrown seagreen
seashell sienna sliver skyblue
slateblue slategray snow springgreen
steelblue tan teal thistle
tomato turquoise violet wheat
white whitesmoke yellow yellowgreen

</BODY> </HTML>

</source>