Prev Next

COLORS

Colour

Color property is used to set the color of the text/element. Color is often specified by:

  • A Hex value like “#ff0000”
  • An RGB value like “rgb(255,0,0)”
  • A color name like “red”

Sample codes

<h1 style="color:green;">this is heading one in green colour</h1>

Will set the text colour green for this H1 element.

<style type="text/css">
 Body {color:yellow;}
 H1{color:green;}
<style> 

Body {color:yellow;} : will set the text color of the entire web page to yellow
H1{color:green;} : Will Set the H1 element text color to green

Leave a Comment