`), the `` tag does not start on a new line and only takes up as much width as necessary. By itself, `` carries no semantic meaning or inherent styling. Instead, its primary purpose is to serve as a hook for CSS styling, JavaScript manipulation, or translation attributes on small chunks of inline content.
### Why Use ``?
* **Targeted Styling:** Apply specific CSS rules (like color, font-weight, or background) to a single word or phrase within a paragraph.
* **JavaScript Hooks:** Easily target and update specific inline text dynamically using DOM manipulation.
* **Localization and Accessibility:** Group inline text to apply language attributes (`lang="es"`) or accessibility attributes (`aria-*`) to a specific segment of text.
---
## Syntax and Usage
The `` tag is a double tag, meaning it requires both an opening tag `` and a closing tag ``.
```html
Your inline content here
```
### Key Attributes
Because `` has no default styling or semantic meaning, it is almost always paired with global attributes. The most common attributes used with `` include:
| Attribute | Type | Description |
| :--- | :--- | :--- |
| `class` | Global | Assigns one or more class names to the element, used to target it with CSS or JavaScript. |
| `id` | Global | Assigns a unique identifier to the element, useful for precise CSS styling or JS selection. |
| `style` | Global | Applies inline CSS styles directly to the element (recommended only for quick testing or dynamic JS styles). |
| `lang` | Global | Specifies the language of the element's content (e.g., `lang="fr"` for French), aiding screen readers and translation tools. |
| `title` | Global | Adds a tooltip that appears when a user hovers over the element. |
| `data-*` | Custom | Stores custom data private to the page or application, easily accessible via JavaScript. |
---
## Code Example
The following example demonstrates how to use the `` tag to style specific words within a paragraph and how to manipulate a `` dynamically using JavaScript.
```html
HTML is the standard markup language for Web pages. With CSS, you can style your pages, but sometimes you only want to style a specific phrase within a sentence.
Notifications 5
System Status: OFFLINE
The Power of the <span> Tag
Tag Span
The `` tag is one of the most fundamental and frequently used elements in HTML. It is an **inline container** used to mark up a part of a text or a part of a document.
Unlike block-level elements (such as `
` or `
YouTip