You are on page 1of 3

8/2/13

HTML head Elements


Search w3schools.com: Select Language

HOME

HTML

C SS

JAVASC RIPT

JQUERY

XML

ASP.NET

PHP

SQL

MORE...

R EFER ENC ES

EXAMPLES

FO R UM

ABO UT

Get Certified
Study Web Technologies and get a diploma at w3schools.com

SHARE THIS PAGE

Like

76k

HTML Basic
HTML HOME HTML Introduction HTML Editors HTML Basic HTML Elements HTML Attributes HTML Headings HTML Paragraphs HTML Formatting HTML Links HTML Head HTML CSS HTML Images HTML Tables HTML Lists HTML Blocks HTML Layout HTML Forms HTML Iframes HTML Colors HTML Colornames HTML Colorvalues HTML JavaScript HTML Entities HTML URL Encode HTML Quick List HTML Summary HTML XHTML

HTML <head>
Previous Next Chapter

WEB HOSTING
Best Web Hosting eUK Web Hosting UK Reseller Hosting Domain, Hosting & Email

Try it Yourself - Examples


<title> - Define a title for an HTML document Use the <title> tag to define a title for a document. <base> - Default URL and target for all links Use the <base> tag to specify a default URL and a default target for all links on a page. <meta> - Provide metadata for an HTML document Use <meta> elements to specify a description, keywords, author, and character set of a document.

WEB BUILDING
XML Editor - Free Trial! FREE Website BUILDER FREE Website C reator Best Website Templates

The HTML <head> Element


The <head> element is a container for all the head elements. Elements inside <head> can include scripts, instruct the browser where to find style sheets, provide meta information, and more. The following tags can be added to the head section: <title>, <style>, <meta>, <link>, <script>, <noscript>, and <base>.

STATISTICS
Browser Statistics OS Statistics Display Statistics

The HTML <title> Element


The <title> tag defines the title of the document. The <title> element is required in all HTML/XHTML documents. The <title> element: defines a title in the browser toolbar provides a title for the page when it is added to favorites displays a title for the page in search-engine results A simplified HTML document:

HTML5 News
HTML5 Intro HTML5 New Elements HTML5 Canvas HTML5 SVG HTML5 Drag/Drop HTML5 Geolocation HTML5 Video HTML5 Audio HTML5 Input Types HTML5 Form Elements HTML5 Form Attributes HTML5 Semantic HTML5 Web Storage HTML5 App Cache HTML5 Web Workers HTML5 SSE

< ! D O C T Y P Eh t m l > < h t m l > < h e a d > < t i t l e > T i t l eo ft h ed o c u m e n t < / t i t l e > < / h e a d > < b o d y > T h ec o n t e n to ft h ed o c u m e n t . . . . . . < / b o d y > < / h t m l >

The HTML <base> Element


The <base> tag specifies the base URL/target for all relative URLs in a page:

< h e a d > < b a s eh r e f = " h t t p : / / w w w . w 3 s c h o o l s . c o m / i m a g e s / "t a r g e t = " _ b l a n k " > < / h e a d >

HTML Media
HTML Media HTML Object HTML Audio HTML Video HTML YouTube

The HTML <link> Element


The <link> tag defines the relationship between a document and an external resource. The <link> tag is most used to link to style sheets:

HTML Examples
HTML Examples HTML Quiz HTML5 Quiz HTML Certificate HTML5 Certificate

< h e a d > < l i n kr e l = " s t y l e s h e e t "t y p e = " t e x t / c s s "h r e f = " m y s t y l e . c s s " > < / h e a d >

The HTML <style> Element


The <style> tag is used to define style information for an HTML document. Inside the <style> element you specify how HTML elements should render in a browser:

HTML References
HTML Tag List HTML Attributes

< h e a d > < s t y l et y p e = " t e x t / c s s " > b o d y{ b a c k g r o u n d c o l o r : y e l l o w }

w3schools.com/html/html_head.asp

1/3

8/2/13
HTML Events HTML Canvas HTML Audio/Video HTML Doctypes HTML Colornames HTML Colorpicker HTML Colormixer HTML Character Sets HTML ASCII HTML ISO-8859-1 HTML Symbols HTML URL Encode HTML Lang Codes HTTP Messages HTTP Methods Keyboard Shortcuts

HTML head Elements


p{ c o l o r : b l u e } < / s t y l e > < / h e a d >

The HTML <meta> Element


Metadata is data (information) about data. The <meta> tag provides metadata about the HTML document. Metadata will not be displayed on the page, but will be machine parsable. Meta elements are typically used to specify page description, keywords, author of the document, last modified, and other metadata. The metadata can be used by browsers (how to display content or reload page), search engines (keywords), or other web services. <meta> tags always go inside the <head> element.

<meta> Tags - Examples of Use


Define keywords for search engines:

< m e t an a m e = " k e y w o r d s "c o n t e n t = " H T M L ,C S S ,X M L ,X H T M L ,J a v a S c r i p t " >


Define a description of your web page:

< m e t an a m e = " d e s c r i p t i o n "c o n t e n t = " F r e eW e bt u t o r i a l so nH T M La n dC S S " >


Define the author of a page:

< m e t an a m e = " a u t h o r "c o n t e n t = " H e g eR e f s n e s " >


Refresh document every 30 seconds:

< m e t ah t t p e q u i v = " r e f r e s h "c o n t e n t = " 3 0 " >

The HTML <script> Element


The <script> tag is used to define a client-side script, such as a JavaScript. The <script> element will be explained in a later chapter.

HTML head Elements


Tag <head> <title> <base> <link> <meta> <script> <style> Description Defines information about the document Defines the title of a document Defines a default address or a default target for all links on a page Defines the relationship between a document and an external resource Defines metadata about an HTML document Defines a client-side script Defines style information for a document

Previous

Next Chapter

Top 10 Tutorials
HTML Tutorial HTML5 Tutorial C SS Tutorial C SS3 Tutorial JavaScript Tutorial jQuery Tutorial SQL Tutorial PHP Tutorial ASP.NET Tutorial XML Tutorial

Top 10 References
HTML/HTML5 Reference C SS 1,2,3 Reference C SS 3 Browser Support JavaScript HTML DOM XML DOM PHP Reference jQuery Reference ASP.NET Reference HTML C olors

Examples
HTML Examples C SS Examples XML Examples JavaScript Examples HTML DOM Examples XML DOM Examples AJAX Examples ASP.NET Examples Razor Examples ASP Examples

Quizzes
HTML Quiz HTML5 Quiz XHTML Quiz C SS Quiz JavaScript Quiz jQuery Quiz XML Quiz ASP Quiz PHP Quiz SQL Quiz

Color Picker

Statistics
Browser Statistics Browser OS

w3schools.com/html/html_head.asp

2/3

8/2/13

HTML head Elements


SVG Examples Browser Display

RE P O RT E RRO R

HO ME

TO P

P RI N T

FO RU M

A BO U T

A D V E RT I SE WI T H U S

W3Schools is optimized for learning, testing, and training. Examples might be simplified to improve reading and basic understanding. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use and privacy policy. C opyright 1999-2013 by Refsnes Data. All Rights Reserved.

w3schools.com/html/html_head.asp

3/3

You might also like