HTML attribute

HTML tags can have attributes. Attributes provide more information about HTML elements.

Attributes always appear as name/value pairs, such as: name="value".

Attributes are always specified in the start tag of the HTML element.

Instance

HTML links are defined by the <a> tag. The address of the link is specified in the href attribute:

<a href="http://www.jquerylearn.com">This is a link</a>

Examples explain: by clicking on the above "This is a link" will jump to  http://www.w3school.com.cn  this site

Property example 1:

<h1> Defines the beginning of the title.

Explanation: Center the <h1> heading title

Property example 2:

<body> Defines the body of the HTML document.

Explanation: The above code means to set the background color of the webpage to yellow.

Hint : Attributes and attribute values ​​are not case sensitive. The new version of (X)HTML requires a lowercase attribute.

Always quote the attribute value

Property values ​​should always be enclosed in quotes. Double quotes are the most commonly used, but there is no problem with single quotes.

In some individual cases, such as attribute values ​​themselves with double quotes, you must use single quotes, for example:

Name='Bill "HelloWorld" Gates'

HTML Property Reference Manual

Our complete HTML reference manual provides a complete list of legal properties that can be used by each HTML element:

Complete HTML reference manual

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

Attributes     value     description
Class     Classname The class name of the specified element (classname)
Id     Id   The unique id of the specified element
Style     Style_definition Specify the inline style of the element
Title     Text Additional information for the specified element (can be displayed in the tooltip)
For more information on standard properties, please visit:

HTML Standard Attributes Reference Manual

Last Updated: 2018-07-06 12:32:44 By akshay

SHARE THIS

share_facebook share_twitter share_google_plus

Please Comment Here :