Basic part
---------------------------------
A: Introduction
HTML is a language used to describe a Web page.
HTML refers to Hypertext Markup Language (Hyper Text Markup Language)
HTML is not a programming language, but a markup language (markup language)
Markup language is a set of tag tags (markup tag)
HTML uses tag tags to describe web pages
HTML tags
HTML tag tags are often referred to as HTML tags (html tag).
HTML tags are keywords surrounded by angle brackets, such as
HTML tags are usually paired up, such as <b> and </b>
The first label in the pair is the start tag, the second is the end tag
Start and end tags are also known as open tags and closed labels
HTML document = Web page
HTML Document Description Web page
HTML documents contain HTML tags and plain text
HTML documents are also called Web pages
The purpose of a Web browser is to read HTML documents and display them as Web pages. Instead of displaying HTML tags, the browser uses tags to interpret the contents of the page:
<body>
<p>my First paragraph.</p>
</body>
Second: Foundation
The HTML title (Heading) is defined by tags such as
The HTML paragraph is defined by the <p> tag.
HTML links are defined by the <a> tag. <a href= "http://www.w3school.com.cn" >this is a link</a>
HTML images are defined by tags.
(picture and document in the same directory)
Three: Elements
HTML elements
The HTML element refers to all the code from the start tag (start tag) to the end tag (end tag).
Start tag element content end tag
<p> This is a paragraph </p>
HTML element syntax
HTML element to start tag starting
HTML element terminated with end tag
The content of an element is the content between the start tag and the end tag
Some HTML elements have blank content (empty contents)
Empty elements are closed in the start tag (ending with the end of the start tag)
Most HTML elements can have properties
Nested HTML elements
Most HTML elements can be nested (other HTML elements can be included).
HTML documents are composed of nested HTML elements.
<body>
<p>this is my first paragraph.</p>
</body>
An empty HTML element
HTML elements that have no content are called empty elements. The empty element is closed in the Start tab.
Even if <br> is valid in all browsers, the use of <br/> is actually a longer term guarantee.
HTML Hint: Use lowercase tags recommended
Four: Properties
Property provides additional information for HTML elements.
HTML tags can have properties. The properties provide more information about the HTML element.
A property is always in the form of a name/value pair, such as: Name= "value".
Attributes are always specified in the start tag of an HTML element.
HTML links are defined by the <a> tag. The address of the link is specified in the href attribute:
Example 1:<a href= "http://www.baidu.com" >this is a link</a> the address of the link is specified in the href attribute
Example 2:<H1 align= "center" >this is heading 1Example 3:<body bgcolor= "Yellow" >
</body> has additional information about the background color
Tip: Use lowercase attributes is recommended
Always quote attribute values
Property values should always be included in quotation marks. Double quotes are the most common, but there is no problem with single quotes.
In some individual cases, such as the attribute value itself contains double quotes, you must use single quotes, for example:
Name= ' Bill ' HelloWorld ' Gates '
HTML attribute reference manual: Http://www.w3school.com.cn/tags/index.asp
HTML Learning One (get started)