HTML properties


May 02, 2021 11:06 HTML


Table of contents


HTML property


Property is additional information provided to HTML elements.


HTML properties

  • HTML elements can set the property
  • Properties can add additional information to an element
  • Properties are typically described in the Start label
  • Property always appears as a name/value pair, for example: name."value".

The instance of the property

HTML links are defined by the label. T he address of the link is specified in the href property:

<a href="https://www.w3cschool.cn">这是一个链接使用了 href 属性</a>

Try it out . . .


HTML properties often refer to property values

Property values should always be included in quotation marks.

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

HTML properties Tip: In some individual cases, such as when the property value itself contains double quotes, you must use single quotes, for example: name'John "ShotGun" Nelson'


HTML Tip: Use small-case properties

Properties and property values are not case sensitive.

However, the World Wide Web Federation recommends smaller properties/property values in its HTML 4 recommendations.

The new version of (X) HTML requires the use of small-case properties.


HTML property reference manual

View the full list of HTML properties: HTML tag reference manual.

The properties that apply to most HTML elements are listed below:

属性 描述
class 为html元素定义一个或多个类名(classname)(类名从样式文件引入)
id 定义元素的唯一id
style 规定元素的行内样式(inline style)
title 描述了元素的额外信息 (作为工具条使用)

More HTML Standard Properties Description: HTML Standard Properties Reference Manual .