HTML Colors

 HTML Colors

HTML Colors define colors that we see on a web page.
 
In this lesson we will use inline styling with CSS properties color and background-color to change the text color and/or background color pf HTML Elements.

HTML Colors can be defined using the following:

    Color Name. It defines any valid color by its color name eg. white , black.
    Hex Color Value or Hexadecimal Color Value. It defines any valid color by a hash followed by letters     and/or numbers eg. #ffffff , #000000 .
    RGB Color Value. RGB stands for Red,Green,Blue.It defines any valid color by this format                    "rgb(number, number, number)" eg. rgb(255, 255, 255), rgb(0, 0, 0).The numbers represent the                     intensity of the red, green and blue colors in that particular order.

Example:

<html>
    <head>
        <title> HTML Colors</title>
    </head>
    <body>
        <!-- changing background color using a color name -->
        <div style="background-color: rgb(0, 92, 49)">    
            <!-- changing text color using a hexadecimal value -->
            <p style="color: #000888">Hexadecimal Color</p>
            <!-- changing text color using a RGB value -->
            <p style="color: rgb(80, 220, 20)">RGB Color</p>
        </div>
    </body>
</html>

Output:


Most Common HTML Colors:




HTML Color Picker

Click the button below to pick a color.



    
                                                                                

Post a Comment

Post a Comment (0)