Attributes are additional information provided by HTML elements.
HTML elements can set the attribute
additional information to an element about an element
href attribute: This is a link< /a>
Commonly used reference attribute values of HTML attributes
Double quotes are the most commonly used, but there is no problem using single quotes. In some individual cases, such as the attribute value itself contains double quotes, you must use single quotes, for example:
Tips: In some individual cases, such as the attribute value itself contains double quotes, you must use single quotes, for example: name='John "ShotGun" Nelson'
Properties and property values are not case-sensitive.
However, the World Wide Web Consortium recommends lowercase attributes/attribute values in its HTML 4 recommendations.
Newer versions of (X)HTML require lowercase attributes.
See the complete list of HTML attributes: HTML Tag Reference Manual.
The following attributes are listed for most HTML elements:
Attributes | describe |
---|---|
class | Define one or more classnames (classnames) for html elements (classnames are introduced from style files) |
id | Define the unique id of the element |
style | Specifies the inline style of the element title text Specifies additional information for the element (can be displayed in the tool tip) |
title | Describes additional information about the element (used as a toolbar) |
The above is the detailed content of Detailed introduction to HTML attributes. For more information, please follow other related articles on the PHP Chinese website!