## HTML class Attribute
The `class` attribute is one of the HTML Global Attributes. It is used to specify one or more class names for an HTML element.
The `class` attribute is primarily used to point to a class in a style sheet (CSS). However, it can also be used by JavaScript (via the HTML DOM) to access and manipulate elements with the specified class.
---
## Browser Support
The `class` attribute is a standard global attribute and is fully supported by all modern web browsers:
* Google Chrome
* Mozilla Firefox
* Microsoft Edge / Internet Explorer
* Safari
* Opera
---
## Syntax
```html
```
### Attribute Values
| Value | Description |
| :--- | :--- |
| *classname* | Specifies the class name of the element.
**Naming Rules & Guidelines:**
β’ Must begin with a letter (`a-z` or `A-Z`).
β’ Can contain letters (`a-z`, `A-Z`), digits (`0-9`), hyphens (`-`), and underscores (`_`).
β’ Class names are **case-sensitive** in HTML.
β’ To assign multiple classes to a single element, separate the class names with a space (e.g., ``). |
---
## Code Examples
### Example 1: Basic Usage with CSS
In this example, we assign classes to an `` and a `
` element to apply specific styles defined in the `
Heading 1
This is a regular paragraph.
Note: This is an important paragraph styled with a class.