colors in css

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>colors in css</title>
    <style>
        #firstpara{
            color:blueviolet; /* color by name */
            background-color: rosybrown;
        }

        #secondpara{
            color: rgb(8717775); /* color by rgb value */
            background-color: rgb(695153);
        }

        #thirdpara{
            color: #ff88ff;
            background-color: #2674bd ; /* color by hex value */
        }
        /* we can add the colors in different ways. the first way is simply by writing down the name of color. the second way is by writing the colors in rgb way. we get the picker while we are adding the colors which is very fun to use. the third way is by adding hex colors. we can add that by writing # and then the value of the color. we can get the values online.  */
    </style>
</head>
<body>
    <h2>This is my first box</h2>
    <p id="firstpara">This is a paragraph from first box</p>
    
    <h2>This is my second box</h2>
    <p id="secondpara">This is a paragraph from second box</p>
    
    <h2>This is my third box</h2>
    <p id="thirdpara">This is a paragraph from third box</p>
</body>
</html>

Comments

Popular posts from this blog

css tutorial

css selectors

developer tools