•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 markup tags to describe web pages
HTML tags
HTML markup tags are often called HTML tags.
•HTML tags are keywords surrounded by angle brackets, such as •HTML tags usually appear in pairs, such as and •The first tag in the pair The tag is the start tag and the second tag is the end tag •Start and end tags are also called open tags and closing tags
HTML elements
HTML elements refer to the tags from start tag to end tag tag).
Start tag
Element content
End tag
This is a paragraph
This is a link
Note: The opening tag is often called an opening tag. , the end tag is often called the closing tag.
HTML element syntax
•HTML elements start with a start tag •HTML elements end with an end tag •The content of the element is the content between the start tag and the end tag •Some HTML elements have empty content ) •Empty elements are closed in the opening tag (ends with the end of the opening tag) •Most HTML elements can have attributes
HTML attributes
HTML tags can have attributes. Attributes 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 opening tag of an HTML element.
Attribute example 1:
defines the beginning of the title.
has additional information about alignment.
TIY: Center the title
Attribute example 2:
defines the body of the HTML document.
has additional information about the background color.
TIY: Background color
Attribute example 3:
Define HTML table. (You will learn more about HTML tables in a later chapter)
has additional information about the table border.
HTML document = web page
•HTML document describes a web page •HTML document contains HTML tags and plain text •HTML document is also called a web page
The role of a Web browser is to read HTML documents and format them in the form of web pages Show them. Browsers do not display HTML tags, but use tags to interpret the content of the page.
My First Heading
My first paragraph.
Explanation with examples
•The text between and describes the web page •The text between
and is the visible page content •
Text between
is displayed as a heading • Text between
and
is displayed as a paragraph
• When you save an HTML file, you can use both .htm and You can use the .html file suffix. We use .htm in our examples. This is just a long-standing habit, because many software in the past only allowed three-letter file suffixes. But for new software, there is no problem using .html.
The above is a detailed explanation of the basic concepts of HTML. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn