What three parts does an element in html5 consist of?
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.
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 the tag 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
, and attributes
.
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:
属性 ↓ <div class="foo">php中文网</div> ↑ ↑ ↑ 开始标签 内容 结束标签
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:
<img src="/static/images/new/logo.png" alt="php中文网Logo" /> <!-- 图像 --> <hr /> <!-- 分割线 --> <br /> <!-- 文本换行 --> <input type="text" placeholder="请输入内容" /> <!-- 文本输入框 -->
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.
[Related recommendations:##
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
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!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.
