Color are very important to give good look to your website.
The Color attributes are written inside the body tag.
There are five attribute.
1. Background Color:- Html provide to give background color to webpage. To give background color we use (bgcolor="Color Name") attribute.
For Example
• By Using Color Name
Code
Code
Code
2. Text:- we can also give color to text to make website more attractive. Attributes is Written inside the <body> tag. attribute is (text="Color Name").
For Example
• By Using Color Name
Output
• By Using Hex color Codes
Code
3. Link:- (link="Color Name") This attribute is used to give color to link that is written inside the website.
4. Alink:- Alink Means Active Link or selected link. Using this attribute change of Color after selecting that link.
Attribute (alink="Color Name")
5. Vlink:-Vlink means Visited link. We can also set the color to Visited link. It is useful for user so that the user cannot click that link again. Attribute (Vlink="Color Name")
For Example
Code
Output
• HTML Color Coding Methods
There are three different methods in Html to set Color in your webpage.
1.Colour Name :-
You can directly give name of the Color in Attitude.
For example :- <body bgcolor="red">
There are 16 Standard W3C list of Color.
1. Black
2. Gray
3. Silver
4. White
5. Yellow
6. Lime
7. Aqua
8. Fuchisa
9. Red
10. Green
11. Blue
12. Purple
13. Maroon
14. Olive
15. Navy
16. Teal
2.Hex Code:-
Frist we will understand the what is Hexadecimal No.
Hexadecimal No contain 16 no.
0 to 9 and A to F.
A represents 10.
B represents 11.
C represents 12.
D represents 13.
E represents 14.
F represents 15.
The Base of Hexadecimal No is 16.
In Hex Code we specify the Color into six digit code which represent ammout of Red,Green,Blue (rgb) That Make Color.
Hex Code look Like This #000000 Hash (#) Indicate Hexadecimal value.
Frist 2 digit dedicated to Red color
Middle 2 digit dedicated Green color
And Last 2 digit dedicated Blue color.
Each primary color is of 8 Bit.
We can give total 256 values as Binary no system is have base 2.
If we calculate 2 to the power 8 we get 256 so we can give 256 value Red,256 to Green and 256 to Blue.
The minimum value we can Give is 0 and the maximum value is 255.
0 indicate the zero density of Color and 255 Indicate the full density of color.
We will understand by an example.
#ff0000
Frist 2 for red
Middle 2 for green
Last 2 for blue
We will see that the red Color is with full density .
List of few color using Hexadecimal notation.
1. #000000
2. #ff0000
3. #00ff00
4. #0000ff
5. #ffff00
6. #00ffff
7. #ff00ff
8. #c0c0c0
9. #ffffff
•Color Decimal Or Percent Values:-
In this method the color value is specified using rgb() property.
For Example
rgb(0,255,255) Means Aqua (cyan) color is in full density.
For example
Code
No comments:
Post a Comment