HTML attributesLOGIN

HTML attributes

HTML Attributes
Attributes are additional information provided by HTML elements.
HTML elements can set attributes;

Attributes are generally described in the opening tag; attributes always appear in the form of name/value pairs, such as: name="value".

Attribute values ​​should always be enclosed in quotes.

Double quotes are the most commonly used, but there is no problem using single quotes.

Note: In some individual cases, such as the attribute value itself contains double quotes, you must use single quotes, for example: name='John "ShotGun" Nelson'

HTML Attribute List

Attribute                         Description


accesskey                                                                                                                                                                                             ​

class ​ ​ ​ ​ ​ ​ Specifies the class name (classname) of the element. Define the text direction of the contents of the content in the content in the content of the content in the content of the content in the contents of the content in the content of the content in the content of the content in the content of the content in the content of the content in the content of the content in the content of the content in the content of the content in the content of the content in the content of the content in the content of the content in the content of the content in one or more class names.

##id                                                                                                                                                                                                                                                  .

# Style specifies the line style of the element. Title specifies the additional information of the element (can be displayed in the tool prompt, as used as a tool bar)

######################################## #HTML links are defined by the <a> tag. The address of the link is specified in the href attribute: ######Instance###
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>php中文网(php.cn)</title>
</head>
<body>
 
<a href="http://www.php.cn">这是一个链接使用了 href 属性</a>
 
</body>
</html>
###Output:######This is a link using the href attribute########### #Tips: #############1. Attributes and attribute values ​​are not case-sensitive. ######It is recommended to use lowercase in the W3C standard, but the new version of (X)HTML requires the use of lowercase attributes. ######2. ###Attribute values ​​should always be enclosed in quotes. #########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: name='John "ShotGun" Nelson'


Next Section
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文网(php.cn)</title> </head> <body bgcolor="green"> <h2>颜色的背景。</h2> </body> </html>
submitReset Code
ChapterCourseware