HTML is a language used to describe web pages.
•HTML refers to Hyper Text Markup Language
•HTML is not a programming language, but a markup language
• Markup language is a set of markup tags
•HTML uses tag tags to describe web pages
HTML tagsHTML tag tags are often called HTML tags.
•HTML tags are keywords surrounded by angle brackets, such as <html>
•HTML tags usually appear in pairs, such as <b> and</b>
•The first tag in the tag pair is the start tag and the second tag is the end tag
• Start and end tags are also called open tags and closed tags
HTML elementsHTML elements refer to all codes from the start tag to the end tag.
| Start tag | Element content | End tag |
|---|---|---|
| <p> | This is a paragraph | </p> |
| <a href=default.htm > | This is a link | </a> |
| <br /> |
Note: The start tag is often called an open tag, and the end tag is often called a closed tag.
HTML element syntax•HTML elements start with the start tag
•HTML elements terminate with end tag
•The content of the element is the content between the start label and the end label
•Certain HTML elements have empty content
•Empty elements are closed in the start tag (end with the end of the start tag)
•Most HTML elements can have attributes
HTML AttributesHTML tags can have attributes. Properties provide more information about HTML elements.
Attributes always appear in the form of name/value pairs, such as: name=value.
Attributes are always specified in the start tag of the HTML element.
Attribute Example 1:<h1> Defines the beginning of the title.
<h1 align=center> Have additional information about alignment.
TIY: Centered title
Attribute Example 2:<body> Defines the body of an HTML document.
<body bgcolor=yellow> Have additional information about background color.
TIY : Background color
Attribute Example 3:<table> Defines HTML tables. (You will learn more about HTML tables in a later chapter)
<table border=1> Have additional information about the table border.
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 in the form of web pages. The browser does not display HTML tags, but uses tags to interpret the content of the page.
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
Example explanation• Text description web page between <html> and </html>
•The text between <body> and </body> is visible page content
• The text between <h1> and </h1> is displayed as a title
•The text between <p> and </p> is displayed as a paragraph
•When you save an HTML file, you can use both .htm and .html file suffix. We use .htm in our instance. This is just a habit that has been formed over a long time, because many software in the past only allowed three-letter file suffixes. However, for new software, there is no problem using .html.
The above detailed explanation of the basic concepts of HTML is all the content shared by the editor. I hope it can give you a reference and I hope you can support Wulin.com more.
Original address: http://www.cnblogs.com/sxtywjx/p/5665033.html