HTML HTML attribute basis ---

Property to provide additional information to the HTML element.

 

A, HTML attributes

 

HTML tags can have attributes. More information about the property HTNL elements

Attributes are always in the form of name / value, such as: name = "value" .

HTML element attributes always start labeling provisions.

 

Second, property instances

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

<a href="http://www.w3school.com.cn">This is a Link</a>

 

Third, more HTML attribute examples

 

1. Property Example 1:

Start <h1> defines a title.

<H1 align = "center"> have additional information about the alignment.

 

<! DOCTYPE HTML the PUBLIC "- // the W3C // DTD HTML 4.01 Transitional // EN" 
"http://www.w3.org/TR/html4/loose.dtd" > 

< HTML > 

< body > 

< h1 align = left = "Center" > This iS heading. 1 </ h1 of > 

< P > the above titles are arranged in the center of the page. The above title has been center-aligned on the page. The above title has been center-aligned on the page. </ P > 

</ body > 
</ HTML >

 

2. Property Example 2:

<Body> define the body of the HTML document.

<Body bgcolor = "yellow"> has additional information about the background color.

 

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="Content-Language" content="zh-cn" />
</head>

<body bgcolor="yellow">
<h2>请看: 改变了颜色的背景。</h2>
</body>

</html>

 

3. Properties Example 3:

<Table> HTML defined form.

<Table border = "1"> has additional information about the table's borders.

 

Four, HTML Tip: Use lowercase property

 

Attributes and attribute values are case -insensitive .

However, the World Wide Web Consortium recommended lowercase attributes / attribute values ​​in their HTML 4 recommendation standard.

The new version of (X) HTML requires the use of lowercase property.

 

Fifth, always quoted as property values

 

Attribute values ​​should always be included in quotation marks. Double quotes are the most common, but can also be enclosed in single quotes.

In some cases, such as the attribute value itself contains double quotes, you must use single quotes, for example:

 

name='Bill "HelloWorld" Gates'

 

Six, HTML attributes Reference Manual

The following lists the properties for most HTML elements:

Guess you like

Origin www.cnblogs.com/Tomorrow-will-be-better/p/11129936.html