content". Tag names are not case-sensitive, but attribute values ​​need to be case-sensitive; and a small number of HTML tags do not have a separate end tag, but add "/" to the start tag to close it."> What three parts does an element in html5 consist of?-Front-end Q&A-php.cn

What three parts does an element in html5 consist of?

青灯夜游
Release: 2022-04-25 13:35:24
Original
3168 people have browsed it

The element in HTML5 consists of three parts: start and end tags, content, and attributes. The syntax is " content". Tag names are not case-sensitive, but attribute values need to be case-sensitive; and a small number of HTML tags do not have a separate end tag, but add "/" to the start tag to close it.

What three parts does an element in html5 consist of?

The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.

The tags in HTML are like keywords. Each tag has its own semantics (meaning). For example, the

tag represents a paragraph, and thetag represents bold. Depending on the tag, the browser will display the content in the tag in different ways.

In actual development, sometimes we also refer to HTML tags as HTML elements. The element in

html5 consists of three parts:starting and ending tags,content, andattributes.

Most HTML elements start with a start tag and end with an end tag. A small number of HTML elements do not have a separate end tag and are closed with "/". The content of the

element is the content between the start tag and the end tag.

The name of the tag is not case-sensitive, but the values of most attributes need to be case-sensitive, as shown below:

属性 ↓ 
php中文网
↑ ↑ ↑ 开始标签 内容 结束标签
Copy after login

In addition to the class attribute, the start tag can also contain Other attribute information, such as id, title, etc.

Note that although HTML tags are not case-sensitive in syntax, for the sake of standardization and professionalism, it is strongly recommended to always use lowercase when defining tags.

When using a browser to open the HTML document we wrote, the browser will read the content in the document from top to bottom, and render the content in the tag in the browser based on the HTML tags and attributes. in the vessel.

An HTML document must have some basic tags so that the browser can distinguish between ordinary text and HTML documents. You can use any number of tags depending on the effect you want to achieve, but there are a few things to note:

  • All HTML tags must be placed within angle brackets < >;

  • Different tags in HTML can achieve different effects;

  • If a certain tag is used, it must be ended with the corresponding closing tag (Except for autism and labels).

Self-closing and tags

Some HTML tags do not have a separate closing tag, but add / in the opening tag to close it. Such labels are called autistic and labelling. Please see the following example:

php中文网Logo  

Copy after login

The closing tag does not need to surround the content, so there is no need for a separate closing tag. Only a small number of HTML tags are self-closing.

## represents HTML comments, which are used to explain HTML code. The browser will ignore the comment content, so users cannot see it in the web page. Go to the comment

[Related recommendations:

html video tutorial,web front-end]

The above is the detailed content of What three parts does an element in html5 consist of?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!