HTML5 Colors
A color in HTML is written #(<red_component>,<green_componbent>,<blue_component>)
eg, #220022
- red component of the color is 22 hexadecimal number
- green component is a 0 hexadecimal number
- blue component is 22 hexadecimal number
Shortcut for defining color codes:
If the color code is - #ffffff will be compressed to #fff
Explanation
Suppose wwe want to define a shade of orange to yellow for a div element of size 40px * 80px,
we will write:
If the color code is - #ffffff will be compressed to #fff
If all the components of primary colors(either red,green or blue) are same you should write it once.
HTML supports 240 color names. eg, red,lightblue,black,yellow,etc.
Gradients represent a transitoion of a color from one shade to another across an HTML element.Suppose wwe want to define a shade of orange to yellow for a div element of size 40px * 80px,
we will write:
- background-image: -webkit-gradient(orange,yellow);
- background-image:-webkit-radial-gradient(circle,white,black);
Comments
Post a Comment