Head Element: Title Tag
Head Element: Title Tag
The head element <head> contains general information, also called metainformation, about a document. Meta means information about. You can say that meta-data means information about data, or meta-information means information about information. The head element includes important information such as the documents title, style instructions, and more.
title Tag
The documents title information inside a head element is not displayed in the browser window, but is used for indexing and cataloging. The result of the following code is shown in Figure 22.2.
base Tag
The example illustrated in Figure 22.3 demonstrates how to use the <base> tag to let all the links on a page open in a new window.
Meta Element
As discussed earlier in the last section, the head element contains general information (meta-information) about a document. HTML also includes a meta element <meta> that goes inside the head element. The purpose of the meta element is to provide meta-information about the document. Most often the meta element is used to provide information that is relevant to browsers or search engines, like describing the content of your document. The meta attributes in the following example identify the documents author, editor, and the software used to create the page.
http://www.w3.org/TR/html4/struct/global.html#adef-http-equiv
N OTE
The lastpage.htm link in the example is a link that is relative to the Web site that you are browsing, and your browser will construct a full Web address to access the page, such as: The scheme is defining the type of Internet service. The most common type is http. The domain is defining the Internet domain name like w3schools.com. The host is defining the domain host. If omitted, the default host for http is www. The :port is defining the port number at the host. The port number is normally omitted. The default port number for http is 80. The path is defining a path (a subdirectory) at the server. If the path is omitted, the resource (the document) must be located at the root directory of the Web site. The filename is defining the name of a document. The default filename might be default.asp, index.html, or something else depending on the settings of the Web server.
noscript Tag
In addition to hiding the script inside a comment, you can also add a <noscript> tag. The <noscript> tag is used to define an alternate text if a script is NOT executed. This tag is used for browsers that recognize the <script> tag, but do not support the script inside, so these browsers will display the text inside the <noscript> tag instead. However, if a browser supports the script inside the <script> tag it will ignore the <noscript> tag.
In This Chapter
Core Attributes Language Attributes Keyboard Attributes HTML tags can have attributes. The special attributes for each tag are listed under each tag description. The attributes listed here are the core and language attributes