This time I will bring you what are the commonly used tags in XHTML, and what are the precautions for using common tags in XHTML. The following is a practical case, let's take a look.
What are XHTML tags?XHTML tag elements are the basic building blocks of XHTML documents. XHTML tags can be understood as the tags used by the XHTML language to define "what is this, what is that" in an XHTML document.
XHTML tags are keywords surrounded by angle brackets, often appearing in pairs, such as . This tag indicates that this is an hmtl (xhtml) document. The first tag in a tag pair is the start tag, and the second tag is the end tag.
There are also a small number of tags that are not paired or have no end tags, such as line break tags
.
XHTML tag closing
In the XHTML specification, all tags must be closed. Usually paired tags are closed with a closing tag, and unpaired tags are closed with a space plus />, such as
.
Although the browser can recognize unclosed tags, from a regulatory and long-term perspective, closing tags is necessary.
tag
This tag indicates that this is an hmtl (xhtml) document. Except for the XHTML file type declaration, all other XHTML tag elements must be embedded within the tag.
<html> <head> ... </head> <body> <p>文字段落等正文内容</p> </body> </html>
This tag defines the title of the entire XHTML document and is used to display in the title bar at the top of the browser window. The tag is nested in
.<head> <title>XHTML 标签 - XHTML教程</title> </head>
XHTML document title is divided into 6 levels, defined by
<h1>一级标题</h1> <h1>二级标题</h1> <h1>三级标题</h1>
XHTML paragraph consists of
Tag definition:
<img src="flower.jpg" alt="花" />
attribute, and the tag will display the flower.jpg image in the browser.
XHTML Form You have mastered the methods of these cases. For more exciting information, please pay attention to php Chinese website
Other
How to use title tags and paragraph tags in XHTML
In HTML/XHTML How to use the img image tag in
In the responsive framework, how to handle the automatic line wrapping of the table header
The above is the detailed content of What are the commonly used tags in XHTML. For more information, please follow other related articles on the PHP Chinese website!