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 are the knowledge points of HTML tags, structures and semantics

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly introduces "what are the HTML tags, structure and semantic knowledge points". In daily operation, I believe many people have doubts about HTML tags, structure and semantic knowledge points. Xiaobian consulted all kinds of data and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "HTML tags, structure and semantic knowledge points". Next, please follow the editor to study!

Overview of HTML

HTML is a language for describing web pages. The full name is Hyper Text Markup Language (Hypertext markup language), which is a markup language made up of many markup tags.

One HTML tag

1, introduction

The HTML language is made up of many tags, and HTML tags are keywords surrounded by angle brackets, such as.

HTML tags are all lowercase.

HTML tags usually appear in pairs, such as and, and separately, such as and

Wait, we call this single label.

The first tag in the tag pair is the start tag, and the second tag is the end tag. Note the difference between the end tag and the start tag.

Many tags can be nested within each other. For example

You can have it. You can have it.

.

The content between the HTML start tag and the end tag is called the HTML element.

1 2

I am a paragraph.

three

four

2, attribute

Each HTML tag can have its own attribute, which is used to describe more details of the HTML element.

Most HTML tags can have the following attributes: name,class,id,style,title. They describe the name of the element, class name, unique id, style, and additional information.

In addition, many HTML tags have their own unique attributes, such as the type of the src,input tag of the img tag, which are owned by some tags.

1 I am a paragraph

Each attribute consists of an attribute name and an attribute value, which are connected by an equal sign. Different properties are separated by spaces. Property values are not case-specific, but lowercase is recommended.

3, style

Style refers to the style of the HTML element, and the style attribute of the HTML tag is used to style the HTML element, including text font, background color, text size, and so on.

1 I am a paragraph

Each style consists of a style name and a style value, which are connected by a colon. Different styles are separated by semicolons. This way of adding styles using the style attribute in HTML tags is called inline styles.

Another way is to use tags in tags, which become internal styles (that is, within HTML documents).

1 2 3 4

Another way is to introduce css files externally with tags in tags, which we call the outreach style.

one

4, script

There are two ways to reference an JavaScript script in an HTML document. The first is similar to the internal style above by writing JavaScript code directly between the opening and closing tags of.

1 2 3 console.log ("hello world") 4 5

The other way is to use tags, but the usage is slightly different.

1 2 3

This way the javascript file is introduced from outside the HTML document. Tags can be used anywhere, but generally we put internal JavaScript code in and externally introduced ones in, but this is not absolute, it is appropriate to choose the right location as needed.

5, comment

1 2 3

6, label

Two-HTML structure

A web page is an HTML document.

1the standard structure of HTML documents

1 2 3 4 5 my title 6 7 8 9 10

Declare the document type on the first line of the document to facilitate browser parsing.

Then there is a pair of tags, which represent the entire web page. Inside the label is and the label:

The tag is used to define the header of the document, which is the container for all header elements. Elements in can reference scripts, tell browsers where to find stylesheets, provide meta-information, and so on. The tags that can be used inside are, as well. It should be necessary.

The body element defines the body of the document. The body element contains all the contents of the document (such as text, hyperlinks, images, tables, lists, and so on). )

2,SEO

The lang attribute of the tag can clearly tell the search engine what language our site is. General Chinese: zh-cn, English: en.

1 2

The tag clearly tells the search engine the theme of our site.

Amoy, I like 2

H2-h7 title label. The content of H2 and h3 tags is highly weighted for search engines.

Tags provide metadata about HTML documents. The metadata is not displayed on the page and is invisible to the user, but is readable to the machine. We can use this tag to clearly tell the search engine about the character set, author, keywords, page description and other information used in our website.

1 2 3 4 5 6

3Jing HTML entity

In HTML, many characters are reserved, such as greater than > and less than

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: 0

*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