מטרת התגית <head>...</head>
, שכבר ראינו בדוגמאות קודמות היא לספק מטה-מידע (meta-data) עבור המסמך. ניתן בעזרתה לקבוע קישורים גלובליים למסמך (כמו גיליון-סגנון, המסמך הבא, המסמך הקודם, הזנות ווב של RSS או Atom, ) וכו לשייך סגנונות הייחודיים לדף. בו נעבור על מה שניתן לעשות.
התגית title הנמצאת בתוך האלמנט <head>...</head>
(ורצוי שתבוא מוקדם ככל האפשר) מאפשרת לקבוע למסמך כותרת גלובלית. זאת בדומה לכותרת של ספר המופיעה בכריכה שלו, או כותרת של מאמר (בעיתון, מדעי וכו) הנמצאת גם בתוכן העניינים.
מומלץ מאוד לקבוע לכל מסמך תגית title משמעותית משום שמנועי חיפוש מציגים אותה בקישור, מה שמלמד על תוכנה, וכן היא מוצגת בכותרת של חלון הדפדפן. ראוי לציין שבתגית ניתן רק להכניס טקסט פשוט ולא תגיות נוספות של ׁHTML . ניתן להכניס בתוכה SGML entities במידת הצורך, אבל בכל מקרה עדיף להשתמש בתווים של UTF-8 במידת האפשר ולהגביל את השימוש ב-entities לתווים מיוחדים כמו &, < >
וכו.
הנה דוגמה קטנה:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"> <head> <title>This title was intentionally left blank.</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <h1>Excerpt from the Three Musketeers</h1> <p> A young man--we can sketch his portrait at a dash. Imagine to yourself a Don Quixote of eighteen; a Don Quixote without his corselet, without his coat of mail, without his cuisses; a Don Quixote clothed in a woolen doublet, the blue color of which had faded into a nameless shade between lees of wine and a heavenly azure; face long and brown; high cheek bones, a sign of sagacity; the maxillary muscles enormously developed, an infallible sign by which a Gascon may always be detected, even without his cap--and our young man wore a cap set off with a sort of feather; the eye open and intelligent; the nose hooked, but finely chiseled. Too big for a youth, too small for a grown man, an experienced eye might have taken him for a farmer's son upon a journey had it not been for the long sword which, dangling from a leather baldric, hit against the calves of its owner as he walked, and against the rough side of his steed when he was on horseback. </p> <p> Taken from <a href="http://www.gutenberg.org/etext/1257">the Project Gutenberg page</a>. </p> </body> </html>