Categories
CSS Tutorials

Other uses of colour

Background color

It is used to set the background color of text or division, etc.

Syntax:

h1 {
  background-color:color_name;
}

Example:

<html>
    <head>
        <title>CSS background color property</title>
        <style>
            h1 {
                background-color:blue;
                text-align:center;
            }
        </style>
    </head>
    <body>
        <h1>
            Edupoly Training and Development
        </h1>
    </body>
</html>

Output:

Border color

It is used to set the border color of an element. Border-style is used to set the border type.

Syntax:

h1 {
  border-style:solid/dashed/dotted;
  border-color:color_name;
}

Example:

<html>
    <head>
        <title>CSS border color</title>
        <style>
            h1 {
                border-style:solid;
                border-color:blue;
                text-align:center;
            }
        </style>
    </head>
    <body>
        <h1>
            Edupoly Training and Development
        </h1>
    </body>
</html>

Output: