The span tag is an inline element used to wrap text content and apply styles. Its attributes include: 1. id: uniquely identifies the element; 2. class: assigns CSS categories; 3. style: applies inline styles; 4. title: provides additional information; 5. lang: specifies language; 6. dir: specifies text Direction; 7. onclick: trigger the click function; 8. ondblclick: trigger the double-click function; 9. onmouseover: trigger the hover function; 10. onmouseout: trigger the move-out function.
Attributes of the HTML span tag
The span tag is an inline element used to wrap text in the document content. It can apply styles to change the appearance of text without changing its document flow. The span tag has the following attributes:
1. id
uniquely identifies the span element and is used for CSS selectors or JavaScript.
2. class
Assign an element to one or more CSS classes so that styles can be applied.
3. style
Apply inline CSS styles directly to elements.
4. title
Provides additional information about the element, usually displayed when the mouse is hovered.
5. lang
Specifies the language of the element content, for assistive technologies.
6. dir
Specifies the direction of the element text (ltr is from left to right, rtl is from right to left).
7. onclick
Triggers the JavaScript function when the element is clicked.
8. ondblclick
Triggers the JavaScript function when the element is double-clicked.
9. onmouseover
Triggers a JavaScript function when the mouse hovers over an element.
10. onmouseout
Triggers the JavaScript function when the mouse moves out of the element.
The above is the detailed content of Attributes of span tag in html. For more information, please follow other related articles on the PHP Chinese website!