HTML and CSS Reference
In-Depth Information
<title>
Function
Defines the document title
Attributes
dir
,
lang
</title>
; never omitted
End tag
Contains
plain_text
Used in
head_content
The
<title>
tag is the only thing required within a document's head. Be-
cause the
<head>
tag itself and even the
<html>
tag can safely be omitted,
the
<title>
tag could be the first line within a valid HTML document. Bey-
ond that, most browsers will even supply a generic title for documents
lacking a
<title>
tag, such as the document's filename, so you don't even
have to supply a title. That goes a bit too far even for our down-and-dirty
tastes, though. No respectable author should serve up a document miss-
ing the
<title>
tag and a title.
When you do include a
<title>
, don't forget to close it with the
</title>
end tag. Otherwise, your title's text ends up displayed in the body of your
document, even though it may precede the
<body>
tag.