Menu ▼

Previous Next

class :

Class attribute will be used to assign a css class to the control.

Syntax :

<div class="classname"></div>


Example :

<html>

<head>

    <title>HTML Tutorial</title>

    <style type="text/css">

        .divyellow

        {

            background-color: Yellow;

            font-size: 20px;

            color: Red;

            height: 100px;

            padding: 30px;

            border:dotted 1px green;

        }

    </style>

</head>

<body>

    <div class="divyellow">

        CSS class applied for this div.

    </div>

</body>

</html>


Output :
HTML Tutorial
CSS class applied for this div.
Previous Next




Search dotnetlearners.com