How to use Class Attribute in HTML5

In this article I am going to explain about class attribute in HTML5.
  • 2305

Class Attribute in HTML5

Class attribute use for call to class in HTML document. Class that we use in HTML this class defined in CSS. We defined class in CSS for making more effective to Html document.

Browser that supports Class Attribute

Internet explorer, Mozilla firefox, Google chrome, opera and Safari browsers.

Syntax

<ElemnetName class="class name">

Example

<html>

<head>

    <style type="text/css">

        .class1

        {

            color: red;

        }

        .class2

        {

            color: blue;

            font-size: 14px;

        }

    </style>

</head>

<body>

    <h1 class="class1">

        Welcome</h1>

    <p class="class2">

        Hello Friends</p>

</body>

</html>

Output

classattribute.jpg

Further Readings

You may also want to read these related articles: here
Ask Your Question 
 
Got a programming related question? You may want to post your question here
 

 

© 2019 DotNetHeaven. All rights reserved.