Detailed introduction to HTML attributes

高洛峰
Release: 2017-03-22 14:27:03
Original
1883 people have browsed it

Attributes are additional information provided by HTML elements.


HTML attributes

  • HTML elements can set the attribute


  • ## Attributes can add

    additional information to an element about an element


  • ## Properties are generally described in the
  • starting tag


  • ## Attributes always appear in the form of name/value pairs,
  • For example: name="value"
  • .

  • Property instance

HTML links are defined by the tag. The address of the link is specified in the

href attribute: This is a link< /a>
Commonly used reference attribute values ​​of HTML attributes

Property 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:

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'


HTML Tip: Use lowercase attributes

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.


HTML Attributes Reference Manual

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template