How DO You Style a DIV Class Using Css

admin_img Posted By Bajarangi soft , Posted On 29-09-2020

In Css we use div class to separate the content to display in proper way..here how we are giving a styles to div element by uisng 'classes' and ' id' by using selectors we can give a styles to css,these selectors will design your web page with styles.

Div classes and id

1.Give a Style To DIv Class Using CSS

<!DOCTYPE html>
<html>
<head>
    <style>
        p {
            text-align: center;
            color: white;
        }
        .paral{
            background-color: blue;
            border: 2px solid red;
        }
        #para1 p{
            color:white;
        }
        .paru{
            background-color: green;
        }
        .hr{
            background-color:lawngreen ;

        }
        #fskj{
            color:mediumvioletred;
            font-size:30px;
        }
    </style>
</head>
<body>
<div class="paral">
    <p>Every paragraph will be affected by the style.</p>
    <p id="para1">Me too!</p>
    <p>And me!</p>
</div>
<div class="paru">
    <p>web page designing using html and css</p>
    <p>web page designing using html and css</p>
    <p>web page designing using html and css</p>

</div>

<p class="hr">
    bajarangi software solutions provide a web designing training
    bajarangi software solutions provide a web designing training
    bajarangi software solutions provide a web designing training
</p>

<h2 id="fskj">Bajarangi soft </h2>

</body>
</html>

Related Post