HTML tutorial-(HTML5 standard) Excerpt notes, html5 excerpt

Source: Internet
Author: User

HTML tutorial-(HTML5 standard) Excerpt notes, html5 excerpt
HTML tutorial-(HTML5 Standard)

Tutorial URL: http://www.runoob.com/html/html-tutorial.html

Http://blog.csdn.net/ljfbest/article/details/6700148

 

HTML Version

 

Since the beginning of the network, many HTML versions have emerged:

Version Release Date
HTML 1991
HTML + 1993
In HTML 2.0 1995
In HTML 3.2 1997
In HTML 4.01 1999
XHTML 1, 1.0 2000
HTML5 2012
XHTML5 2013

 

 

<! DOCTYPE> Declaration

<! DOCTYPE> declaration helps the browser to correctly display webpages.

There are many different files on the network. If the HTML version can be correctly declared, the browser can correctly display the webpage content.

The doctype statement is case-insensitive and can be used in the following ways:

<!DOCTYPE html> <!DOCTYPE HTML> <!doctype html> <!Doctype Html>

 

 

General Declaration HTML5
<!DOCTYPE html>

 

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

 

XHTML 1, 1.0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

View the DOCTYPE reference manual for the complete website declaration type.

 

Chinese Encoding

Currently in most browsers, the direct output of Chinese will appear Chinese garbled, at this time we need to declare the character in the header as a UTF-8.

HTML instance
<! DOCTYPE html> 

 

HTML Element

HTML documents are defined by HTML elements.

Empty HTML Element

HTML elements without content are called empty elements. Empty elements are disabled in the start tag.

<Br> is an empty element that does not close the tag (<br> label definition line feed ).

In XHTML, XML, and HTML of future versions, all elements must be disabled.

Adding a slash to the start tag, such as <br/>, is the correct method to disable empty elements. HTML, XHTML, and XML both accept this method.

Even if <br> is valid in all browsers, using <br/> is actually a long-term guarantee.

HTML prompt: use lower-case tags

HTML tags are not case sensitive: <P> equivalent to <p>. Many websites use uppercase HTML tags.

The cainiao tutorial uses lower-case tags because the World Wide Web Consortium (W3C) is in HTML 4.RecommendationUse lower-case letters, and in future (X) HTML versionsForceUse lower-case letters.

 

HTML attributes

Attribute is the additional information provided by the HTML element.

HTML attributes
  • HTML elements can be setAttribute
  • Attribute can be added to an element.Additional information
  • Attribute is generally described inStart tag
  • Attributes always appear in the form of name/value pairs,For example: name = "value".
Common HTML Property Reference property values

Attribute values should always be enclosed in quotation marks.

Double quotation marks are the most commonly used, but it is no problem to use single quotation marks.

Tip:In some cases, for example, if the attribute value itself contains double quotation marks, you must use single quotation marks. For example, name = 'John "ShotGun" Nelson'

 

 

HTML prompt: use lower-case attributes

 

Attributes and attribute values are not case sensitive.

 

However, the World Wide Web Alliance recommends lower-case attributes/attribute values in its HTML 4 Recommendation Standard.

 

The new version (X) HTML requires lower-case attributes.

 

 

HTML attribute Reference Manual

 

View the complete HTML attribute list: HTML Tag reference manual.

 

Attributes applicable to most HTML elements are listed below:

 

Attribute Description
Class Define one or more class names (classname) for html elements (class names are introduced from style files)
Id Unique id of the defined element
Style Specifies the line style of an element)
Title Additional information about the element (used as a toolbar)

 

For more information about standard attributes, see the HTML standard attributes reference manual.

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.