color property allow the color of text inside an element to be specified, background color.

Colors can be specified by

  • rgb values rgb(0,0,0,)
  • Hex codes 6 digit hex codes preceded by the # sign.  #ee3e80
  • color names there are 147 predefined color names
  • HSLA

color of text

an example would be h1{ color:darkgary;}

background color

h1{ background-color : blue; }

css assumes a box around the html element .

Also for headers or the body of a page one can use padding to seperate the text from the edges of the box.

Page default values are transparent.



Comments (0)

500 characters remaining

Cancel or