class attribute

class=classname

Explanation

Class attribute is used to apply common set of font, style, size for the texts in a content. It is used for style purposes.
<element class="classname">
Values added with this attribute are:
ValueDescription
classnameClass mentioned in a stylesheet.

Example Code:

Result :

Roses

There are about 100 types of Roses are available

  • It will not have an effect if it is used with the following HTML tags like base, head, html, meta, param, script, style, and title.
  • It reduces the repetitive works done by a user.
  • It is possible to apply multiple class in a HTML document.
  • It specifies the class name for an element.

Limitations:

It is applicable to all the major browsers.

Ask Questions

Ask Question