Thursday, September 15, 2011

07 - Applying Color


   Applying color on Text through Inline CSS


Inline CSS: Applying CSS in Tag itself. Here we want to apply text color in a paragraph.
<html >
<head>
</head>
<body>
<h2>1) Applying color through Hexa-decimal values(#03C)</h2>

<p style="color:#03C"> Text color of this paragraph is blue</p>

<h2>2) Applying color through string values(blue)</h2>
<p style="color:blue"> Text color of this paragraph is blue</p>
<body>
</html> 

Output in Browser :

 1) Applying color through Hexa-decimal value(#03C)

Text color of this paragraph is blue

2) Applying color through string value(blue)

Text color of this paragraph is blue

 

There are 17 valid predefined colour names. They are aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, orange, purple, red, silver, teal, white, and yellow.

transparent is also a valid value.



   Internal CSS: Applying CSS in head Tag between style tag. Here   
   we want to apply text color in a paragraph. 

<html >
<head>
<style>
    p{color:
#03C}
</style>

</head>
<body>
<p> Text color of this paragraph is blue</p>
<body>
</html> 

Output in Browser :

Text color of this paragraph is blue



 powered by multimediagyan ©

No comments:

Post a Comment