Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the basic syntax of html5

2025-01-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the relevant knowledge of "what is the basic grammar of html5". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "what is the basic grammar of html5" can help you solve the problem.

HTML5 tag

HTML is not a programming language, but a markup language (Hyper Text Markup Language). HTML5 tags are keywords enclosed in angle brackets, such as.

HTML5 tags usually appear in pairs, such as the first tag is the start tag and the second tag is the end tag.

Syntax:

Pairs of tags work only on the text contained in it

In each tag, uppercase, lowercase or mixed case can be used.

element

The HTML5 element refers to all the code from the start tag to the end tag.

For example:

This

Element defines a paragraph in an HTML5 document that has an opening tag

And a closing tag.

.

Another example is:

This element defines a hyperlink, which consists of a start tag and an end tag. The content of the element is Taobao, and the href attribute represents the hyperlink address of the element.

In the syntax of HTML5, each element formed by HTML5 tags and text can also contain another element. The entire HTML5 file is like a large element that contains many small elements.

Basic structure of HTML5 file

< head>

Vs.

< /head>

The element between is the header of the html5 file, which describes the title of the file and some common attributes of the entire file

< body>

And

< /body>

It is the main part of the file, and most of the functions we want to implement are implemented between the two tags.

Basic label of HTML5

1. File start label

In any html file, the first html tag that appears is

< html>

That identifies that the file is written in HTML and that all the contents of the file are contained in the

< html>

And

< /html>

Between.

The tag does not have any attributes.

In fact, commonly used web browsers can automatically recognize html files, but you should still get into the habit of using this tag.

two。 File header label

The html file can be divided into two parts: the file header and the file body. The body of the file is what you see in the user area of the web browser window. The file header is used to specify the title of the file (which appears in the title bar of the web browser window) and some attributes of the file. It contains the title of the file, encoding and url and other information, used to provide indexing, identification or other applications.

If the text is written in

< title>

Tag, the name of the page is displayed at the top of the window as the name of the window.

(if the html file does not need to provide relevant information, you can omit it

< head>

Label. )

3. File title label

The name of the web page is written in

< title>

And

< /title>

Between,

< title>

The label should be included in the

< head>

And

< /head>

In the label.

4. Meta-information label

The information provided by the meta element is invisible to the user and is not displayed on the page. It is generally used to define the name, keyword, author, and so on of the page information. In HTML, the meta tag does not need to set the closing tag, it is a meta content in an angle bracket, but there can be multiple mata elements in a html header page. There are two attributes of meta elements: name and http-equiv, in which the name attribute is mainly used to describe the web page, so that the search engine robot can find and classify it.

5. Page body tag

There are many attribute settings in the body tag section of the page, as follows:

Attribute description

Text sets the color of page text

Bgcolor sets the color of the background of the page

Background sets the background image of the page

Bgproperties sets the background image of the page to be fixed and does not scroll as the page scrolls

Link sets the default link color for the page

Alink sets the color of the link when the mouse is clicked

Vlink sets the link color after access

Topmargin sets the top margin of the page

Leftmargin sets the left margin of the page

This is the end of the introduction to "what is the basic Grammar of html5". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 216

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report