HTML – The Head Element
The HTML <head>
element is a container for the following elements: <title>
, <style>
, <meta>
, <link>
, <script>
, and <base>
.
The HTML <head> Element
The <head>
element is a container for metadata (data about data) and is placed between the <html>
tag and the <body>
tag.
HTML metadata is data about the HTML document. Metadata is not displayed.
Metadata typically define the document title, character set, styles, scripts, and other meta information.
The HTML <title> Element
The <title>
element defines the title of the document. The title must be text-only, and it is shown in the browser’s title bar or in the page’s tab.
The <title>
element is required in HTML documents!
The contents of a page title is very important for search engine optimization (SEO)! The page title is used by search engine algorithms to decide the order when listing pages in search results.
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
So, try to make the title as accurate and meaningful as possible!
A simple HTML document:
Example
<!DOCTYPE html> <html> <head> <title>A Meaningful Page Title</title> </head> <body> The content of the document...... </body> </html>
The HTML <style> Element
The <style>
element is used to define style information for a single HTML page:
Example
<style> body {background-color: powderblue;} h1 {color: red;} p {color: blue;} </style>
The HTML <link> Element
The <link>
element defines the relationship between the current document and an external resource.
The <link>
tag is most often used to link to external style sheets:
Example
<link rel="stylesheet" href="mystyle.css">
The HTML <meta> Element
The <meta>
element is typically used to specify the character set, page description, keywords, author of the document, and viewport settings.
The metadata will not be displayed on the page, but are used by browsers (how to display content or reload page), by search engines (keywords), and other web services.
Examples
Define the character set used:
<meta charset="UTF-8">
Define keywords for search engines:
<meta name="keywords" content="HTML, CSS, JavaScript">
Define a description of your web page:
<meta name="description" content="Free Web tutorials">
Define the author of a page:
<meta name="author" content="John Doe">
Refresh document every 30 seconds:
<meta http-equiv="refresh" content="30">
Setting the viewport to make your website look good on all devices:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Example of <meta>
tags:
Example
<meta charset="UTF-8"> <meta name="description" content="Free Web tutorials"> <meta name="keywords" content="HTML, CSS, JavaScript"> <meta name="author" content="John Doe">
Setting The Viewport
The viewport is the user’s visible area of a web page. It varies with the device – it will be smaller on a mobile phone than on a computer screen.
You should include the following <meta>
element in all your web pages:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
This gives the browser instructions on how to control the page’s dimensions and scaling.
The width=device-width
part sets the width of the page to follow the screen-width of the device (which will vary depending on the device).
The initial-scale=1.0
part sets the initial zoom level when the page is first loaded by the browser.
Here is an example of a web page without the viewport meta tag, and the same web page with the viewport meta tag:
Tip: If you are browsing this page with a phone or a tablet, you can click on the two links below to see the difference.

Without the viewport meta tag

With the viewport meta tag
The HTML <script> Element
The <script>
element is used to define client-side JavaScripts.
The following JavaScript writes “Hello JavaScript!” into an HTML element with id=”demo”:
Example
<script> function myFunction() { document.getElementById("demo").innerHTML = "Hello JavaScript!"; } </script>
Tip: To learn all about JavaScript, visit our JavaScript Tutorial.
The HTML <base> Element
The <base>
element specifies the base URL and/or target for all relative URLs in a page.
The <base>
tag must have either an href or a target attribute present, or both.
There can only be one single <base>
element in a document!
Example
Specify a default URL and a default target for all links on a page:
<head> <base href="https://www.apostube.com/" target="_blank"> </head> <body> <img src="images/stickman.gif" width="24" height="39" alt="Stickman"> <a href="tags/tag_base.asp">HTML base Tag</a> </body>
Chapter Summary
- The
<head>
element is a container for metadata (data about data) - The
<head>
element is placed between the<html>
tag and the<body>
tag - The
<title>
element is required and it defines the title of the document - The
<style>
element is used to define style information for a single document - The
<link>
tag is most often used to link to external style sheets - The
<meta>
element is typically used to specify the character set, page description, keywords, author of the document, and viewport settings - The
<script>
element is used to define client-side JavaScripts - The
<base>
element specifies the base URL and/or target for all relative URLs in a page
49 Responses
buy levaquin 500mg generic levofloxacin over the counter
buy avodart 0.5mg for sale order zofran 8mg online zofran 4mg brand
ampicillin sale brand bactrim 960mg generic erythromycin
buy sildenafil pill sildenafil 100mg us buy robaxin without prescription
buy suhagra online cheap sildenafil for sale order estradiol 2mg without prescription
order lamictal 200mg pill generic tretinoin gel tretinoin cream tablet
buy tadalis generic tadalis oral buy diclofenac online
purchase accutane isotretinoin for sale zithromax 250mg without prescription
buy indocin without prescription buy cefixime sale order trimox generic
cheap tadalafil sale what is the best ed pill order sildenafil online
arimidex 1 mg tablet Real viagra purchase viagra generic
cialis 10mg generique en pharmacie cialis 5mg pas cher sildenafil 200mg generique pas cher
deltasone 10mg tablet viagra sildenafil 100mg buy viagra 50mg for sale
cialis 10mg generika rezeptfrei kaufen viagra 200mg kaufen für männer sildenafil für männer
buy isotretinoin 20mg pill buy amoxil 250mg where can i buy ivermectin
doxycycline 200mg drug furosemide tablet buy furosemide online cheap
buy altace pills buy temovate generic azelastine sprayers
catapres generic minocycline 50mg canada order spiriva 9mcg for sale
order buspirone 10mg online order buspirone 10mg generic buy ditropan generic
terazosin 5mg brand buy leflunomide generic azulfidine online order
cost fosamax pepcid 20mg us pepcid 20mg us
buy olmesartan 20mg pill buy acetazolamide generic diamox 250mg oral
cheap prograf order ropinirole 2mg generic buy ursodiol 300mg without prescription
buy generic isosorbide brand digoxin buy micardis 20mg online cheap
zyban pills cetirizine 10mg over the counter buy seroquel for sale
molnunat pills prevacid cheap cheap prevacid 15mg
order zoloft 100mg generic kamagra 200mg cost sildenafil 50mg drug
salbutamol 100 mcg us buy generic pantoprazole 20mg viagra fast shipping
discount cialis buy viagra online legally order viagra online
order naltrexone 50mg pill albenza brand abilify for sale online
buy generic avlosulfon perindopril price order aceon generic
medroxyprogesterone tablet order periactin pill buy periactin 4mg generic
purchase provigil for sale purchase provigil generic stromectol tablets uk
buy fluvoxamine 50mg online buy luvox generic purchase glipizide online cheap
order accutane order isotretinoin 20mg pills deltasone cheap
cost piracetam 800 mg cheap sildenafil generic viagra usa
cheap azithromycin order zithromax sale buy neurontin tablets
order lasix 100mg online cheap lasix 100mg drug generic plaquenil 400mg
cialis 10mg usa generic clomipramine 25mg anafranil tablet
출장마사지
ErnestEvage
https://xn—24-7-3vebahb3baz2czbsdzdf9b3a4x.xn--p1ai/
https://xn--24-7–3vefjh5cxa7amcku4ap.xn--p1ai
https://xn—24-7-3vebi7a0c8ajhwdyl9mh.xn--p1ai/
https://xn—-24-7-3nfzigf2folbfai2a2a8d2e3c.xn--p1ai
https://xn—-24-7-2nfbpd5dza0bncg0a6al.xn--p1ai
https://xn—24-7-4vevhge6enkbeai0a1a5dye2c.xn--p1ai
https://xn—24-7-3vebnd9cxa7amcgy4al.xn--p1ai
comprar cialis 5 mg precio cialis 5 mg en farmacia cialis 5 mg
cialis 5 mg precio tadalafil 5 mg comprar cialis 5 mg
%image_title% is the top notch!
https://hankook1.online
https://nokian1.online
https://prodvizhenie-sait.ru
https://seo-top-site.ru
https://yokohama1.online
https://toyo1.online
https://pirelli1.online
https://akita-kennel.ru
https://domodedovo2012.ru
https://michelin1.online
https://testcars.ru
https://goodyear1.online
https://cordiant-1.online
https://tireservice1.online
https://kormoran1.online
https://kupitshin.online
https://sekup.ru
https://o-dom2.ru
https://vash1host.ru
https://bridgestone2.ru
https://mytop-site.ru
https://seo-privat.ru
https://toyo1.online
летние шины 175 65 14
cinturato p1 verde
FloydCew
https://goodyear1.online
продвижение сайта по трафику
продвижение сайтов недорого частник
https://testcars.ru
отзывы winter i pike rs2 w429
оникс
GregoryNuG
https://pirelli1.online
оптимизация и продвижение сайтов seo раскрутка сайтов
продвижение сайта комплексно
https://kupitshin.online
доставка шин rosava
внедорожные шины нексен
Davidbem
https://tireservice1.online
сео сайта стоимость
продвижение сайтов сео
https://goodyear1.online
kumho
спортивные шины onyx
Jefferyrex
https://seo-top-site.ru
раскрутка сайтов в яндекс москва мск сео
ооо продвижение
DonaldKat
https://xn—24-7-3vebnd9cxa7amcgy4al.xn--p1ai
https://xn—24-7-3vebahb3baz2czbsdzdf9b3a4x.xn--p1ai/
https://xn—24-7-4vevhge6enkbeai0a1a5dye2c.xn--p1ai
https://xn--24-7–3vefjh5cxa7amcku4ap.xn--p1ai
https://xn—-24-7-2nfbpd5dza0bncg0a6al.xn--p1ai
https://xn—-24-7-3nfzigf2folbfai2a2a8d2e3c.xn--p1ai
https://xn—24-7-3vebi7a0c8ajhwdyl9mh.xn--p1ai/