HTML Head is the section 7 of Beginner’s Guide to HTML.
We already came across with body element. There can’t be a body without a head, isn’t it? So let’s see what’s on the HTML head. The element is a container for all the head elements. Inside the head element we do following things.
- Have title for the web page
- Include scripts
- Instruct the browser where to find style sheets
Like as in the class example, we define the style of elements. Here we defined all the
element font color is green and
element font color is blue.
The tag defines the relationship between a document and an external resource. Widely used this to import external CSS files. If you don't want inline styles, you can use this element. We'll go deeply into this on the CSS tutorial.
Just see how it can be used.[code language="html"] Meta
For data about data, we called metadata. The tag provides metadata about the HTML document and it will not be displayed on the web browser. It typically used to specify page description, keywords, author of the document, last modified, and other metadata. Web browsers use this data to display the content or reload the page as metadata specifies. Search engines used keywords in the metadata and web services also found metadata beneficial.
Let's see few examples of usage.
Define keywords for search engines.[code language="html"] Define a description for the web page. [code language="html"] Define web page author. [code language="html"] Define page reload time.
For every 30 seconds page will be refreshed.[code language="html"] Noscript
This specifies the base URL/target for all relative URLs in a page.[code language="html"] Now on you do not need to write the whole url address on any link in the HTML document. Because we defined the base of all the urls are http://www.letsdnd.com/. Also we defined by target attribute that all the links should be open on a new browser window or a new tab.
In this section we learned about head element. In the next section we'll do something colorful as we guess you're now a little bit bored on typing text.
Let's Add Images on HTML