Explain HTML Document head In detail
https://www.computersprofessor.com/2016/06/explain-html-document-head-in-detail.html
The head is a very important part of
any html page. It contains lots of control information that is needed by
browsers and servers.
|
Document type declaration:(DTD)
Before the initial < html > tag the
type of the document should be specified.
The document type declaration for
basic html is :
< ! doctype html public “ – //w3c
// dtd.html 4.0//en” “ http: //www.w3.org /TR/PR.html 4.0/loose.dtd”>
The W3C has created the
following dtd’s for html
® loose.dtd
® strick.dtd
® traditional.dtd
® frameset.dtd.
|
Control information:
The head of the document contains
control information to be used by serves and browsers.
It contains the title of the
document which will be display at the top of the browser and optionally a
list of keywords a description of document any files to be linked into the
document and information about how the document was prepared
< ! doctype html public “ –//w3c//dtd.html
4.0//in” “http. //www. W3. Org/TR/PR.html 4.0/loose.dtd”>
< html >
< head >
< link rel = “ style sheet” href
= “/ test. css” type = “textless” >
< meta name = “author” content =
“ chris bates” >
< meta http - equiv = “expires”
content = “wed 05 Dec 2016”>
< meta name = “ description”
content = “ online catalogue” >
< title > Bill smiggins inc
< /title >
< /head >
< body>
< /body >
< /html >
All the html documents have just one
title which is displayed at the top of the browser window.
The ‘title’ is also used as the name
in bookmark files and on search engines.
The html recommendation is that
valid html documents must have a title.
< link rel = “ style sheet” href = “
/test.css” type = “text less”>
The < link > tag is used to
allow other documents to be linked (or) included in the current document.
This tag has not commonly used, but
it is important and useful when using ‘style sheets’.
< meta name = “ author” content =
“ chris bales” >
< meta http-equiv= “ expires”
content = “wed 18 oct 2016”>
Any information which describes the whole
document should be included using one of these two alternatives.
There are many possible < meta
> tags. Meta tags can take a ‘URL’ as a parameter. Usually this will be
inside the ‘content’ attribute. The ‘http-equiv’ attribute is used to define
meta data which is intended to be part of an http response message.
The first two meta tags in the above
example indicate the author of the document which is useful for version
control and an expiry data which tells the browser to reload from the server.
The third meter tag is the example
which gives a description of the document to be used by website and indexing
engines.
|