HTML Common Tags and Attributes
HTML (Hypertext Markup Language) is a standard markup language used to create web pages. This article describes some of the most commonly used HTML tags and attributes.
tags
- Title tag (h1-h6): Define the title text, where h1 is the most important and h6 is the least important.
- Paragraph tag (p): Contains paragraph text.
- List tags (ul, ol): Create an unordered list (ul) or an ordered list (ol).
- Link tag (a): Create a link and specify the href attribute to specify the target URL.
- Image tag (img): Display the image on the page, the src attribute specifies the image source.
- Table tag (table): Create a table structure and use tr and td tags to specify rows and columns.
Attribute
- id attribute: Specifies a unique identifier for the element.
- class attribute: Specifies the CSS class for the element, which can be used for styling.
- href attribute: For the a tag, specifies the URL of the link target.
- src attribute: For img tags, specifies the path to the image source.
- alt attribute: Provides an alternative text for the image, for accessibility purposes or when the image is unavailable.
- width and height attributes: Specify the width and height of the element.
- style attribute: Directly specify the CSS style of the element.
The above is the detailed content of What are the commonly used tags and attributes in html?. For more information, please follow other related articles on the PHP Chinese website!