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 header elements of an html document and how to use them

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

Share

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

This article mainly introduces the html document header elements and how to use the relevant knowledge, the content is detailed and easy to understand, the operation is simple and fast, with a certain reference value, I believe you read this html document head elements and how to use the article will have a harvest, let's take a look at it.

Html element

The element is used to define the header of the document and is the container for all other header elements. The various attributes and information of the HTML document are defined in the element.

Let's take a look at a simple html document that has the most basic necessary elements:

one

two

three

four

five

six

seven

eight

nine

Title

As you can see, the element lies between the tag and the tag, including other header elements.

Html element

Elements are used to specify character sets, page descriptions, keywords, authors, and other metadata on a web page.

Among them, metadata is mainly provided to browsers, search engines and other Web services to better rank web pages.

Let's take a look at how to use elements:

one

two

three

four

five

six

seven

eight

nine

ten

eleven

twelve

thirteen

fourteen

fifteen

sixteen

seventeen

/ / define character set

/ / define keywords for search engines

/ / define the description of the web page

/ / define the author of the web page

/ / defines that the document is refreshed every 30 seconds:

/ / Control viewports (new properties provided by HTML5)

Description: viewports are visible areas for users on a web page. It varies from device to device and looks smaller than a computer screen on a mobile phone.

Html element

The element is the title used to define the document; it applies to all HTML or XHTML documents.

The role of the element:

1. You can define the title in the browser tab.

2. You can provide a title for the page when adding to your favorites.

3. You can display the title of the page in the search engine results.

Example:

one

two

three

four

five

six

seven

eight

nine

ten

eleven

Php Chinese website

The contents of the body are displayed in the browser window.

The contents of the title element are displayed in browser tags, favorites, and search engine results.

Effect picture:

Html element

The element is used to style the HTML page, and the inline css style code is written inside the element. Example:

one

two

three

four

five

six

seven

eight

Body {background-color:pink;}

H2 {color:red;}

P {color:blue;}

This is a title.

This is a paragraph.

Effect picture:

HTML element

Element is used to link an external css style sheet to a Web page. The basic syntax is:

one

Example:

one

HTML element

Elements are used to define client script, such as JavaScript.

We can include script statements in the element, for example:

one

two

three

Console.log ("element")

Output:

You can also link an external script file to a web page through the src attribute, for example:

one

HTML element

Element is used to specify the basic URL and basic goals for all relative URL in the page. Example:

one

This is the end of the article on "what are the header elements of html documents and how to use them?" Thank you for reading! I believe you all have a certain understanding of the knowledge of "what are the header elements of html documents and how to use them?" if you want to learn more, you are welcome to follow the industry information channel.

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