Class Selector In CSS

     

  • It allows us to provide style for group of elements
  • Advantage of this "Class Selector" is once we created we can use multiple times with any HTML element.
  • It is defined with" . "symbol
  • In this example we have defined "abc" as Class selector.
  •  

    <html>
    <head>
    <title>CSS Class Selector</title>
    <style type="text/css">
    .abc {
    color: red;
    font-size: 150%;
    text-align:left;
    font-family: book antiqua;
    Text-decoration: none;
    }
    </style>
    </head>
    <body>
    <p class="abc">This is about Class Selector</p>
    <h1 class="abc">This is about Class Selector</h1>

    </body>
    </html>

     

    Output:

    Download The Coding Along With Web Page