The importance of adding some attributes to the head of an HTML page

Source: Internet
Author: User
Tags add html page prev client
Web page

Both HTML and XHTML have a structure that enables Web page authors to add additional information related to HTML documents. These additional resources can be styling information (CSS), navigation assistants, information that belongs to another form (RSS), contact information, and so on.

Link element is used to add these elements to the

Let's take a look at a practical example of an astronomical website on a page. This page is about the Earth's position in the solar system.

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
<title>earth-astronomy weblog</title>

The classic HTML document begins.

<link rel= "Start" href= "/solar-system/"/>
<link rel= "Prev" href= "/solar-system/venus/"/>
<link rel= "Next" href= "/solar-system/mars/"/>

These connections help with navigation for some client side.

Start provides the starting point for the location
Prev provides the previous project, here is Venus
Next to provide a project, here is Mars

<link rel= "Contents" href= "/solar-system/contents.html"/>

Contents indicates the index of this location

<link rel= "Help" href= "/website-help.html"/>

Help provides the ability to connect to a page that helps visitors use your site.

<link rel= "Alternate" type= "Application/rss+xml" title= "RSS" href= "/UPDATES.RDF"/>

It enables RSS readers to find feedback on Web site updates. Note that the Applications/rss+xml MIME type is still a draft of the Applications/rss+xml media type, and has not yet been accepted by the IETF.

<link rel= "meta" type= "Application/rdf+xml" title= "FOAF" href= "HTTP://ASTRO.EXAMPLE.ORG/FOAF.XRDF"/>

It allows the FOAF reader to find the metadata of the document, possibly the author. Note that the application/rdf+xml has not yet been accepted by the IETF, and no further progress has been made since the last proposal was passed.

<link href= "mailto:webmaster@webjx.com" rev= "made"/>

A way to contact a website author

<link rel= "stylesheet" type= "text/css" media= "screen" href= "/style/astro.css"/>

Specify CSS to represent your site. For example, in this connection, we have already pointed out that the stylesheet is for the screen display. We can also have other style sheets for other media.

<link rel= "Alternate" href= "/solar-system/earth.fr" hreflang= "fr" title= "French translation"/>

It gives an entrance to another language translation of this document, in this case French.

It closes the head area and begins the main area.

These connections are used by the client (browser) and other programs to help people use your site.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.