You are on page 1of 8

HTML <!

DOCTYPE> tag
On the HTML document you have often seen that there is a <!DOCTYPE html>
declaration before the <html> tag. HTML <!DOCTYPE> tag is used to inform the
browser about the version of HTML used in the document. It is called as the
document type declaration (DTD).
Technically <!DOCTYPE > is not a tag/element, it just an instruction to the browser
about the document type. It is a null element which does not contain the closing
tag, and must not include any content within it.
Actually, there are many type of HTML e.g. HTML 4.01 Strict, HTML 4.01
Transitional, HTML 4.01 Frameset, XHTML 1.0 Strict, XHTML 1.0 Transitional, XHTML
1.0 Frameset, XHTML 1.1 etc
HTML head section
• The <head> tag
The <head> tag is what actually begins the head section of an HTML document. The
head section of an HTML document contains several tags that specify important
information about the webpage such as title, keywords and descriptions (for search
engines), location of stylesheets, scripts, and more.
• The <base> tag
The <base> tag acts as a reference point for all the links on a page. This reference
point is specified with the <base> tag's href attribute.
• The <link> tag
The <link> tag defines a relationship between two douments. It is used to define the
relationship between the document where it is located and another document.
• <link rel="stylesheet" type="text/css" href="/css/style.css" />
• The <meta> tag
The <meta> tag is used to describe the page in some way as well as other
things such as refreshing a page automatically after a certain amount of
time, and preventing webpages from being displayed in another websites
frames page. Some of the things that can be described using the <meta> tag
include the pages author, the software used to create the page, and a
description of the content on the page.

• The <script> tag


The <script> tag is used to place scripts on a webpage. When using
the <script> tag, you have to use its type attribute to specify the language
the script is written in.

• The <title> tag


• The <title> tag declares the title for a webpage. The title of a webpage can
be seen in the top left corner of the web browser. If you look at the top left
corner of your web browser window right now, you will see the title HTML
head section, as that is the title of this page.
HTML Entity
• Some characters are reserved in HTML.
• If you use the less than (<) or greater than (>) signs in your text, the
browser might mix them with tags.
• Character entities are used to display reserved characters in HTML.
EX:- code output
<p>this how entity <works> here </p>

<p>this how entity &lt;works&gt; here </p> this how entity >works< here
Header and Footer
Layout

•<header> - Defines a header for a document or a section


•<nav> - Defines a container for navigation links
•<section> - Defines a section in a document
•<article> - Defines an independent self-contained article
•<aside> - Defines content aside from the content (like a
sidebar)
•<footer> - Defines a footer for a document or a section
•<details> - Defines additional details
•<summary> - Defines a heading for the <details> element
Audio
• The controls attribute adds audio controls, like play, pause, and
volume.

• The <source> element allows you to specify alternative audio files


which the browser may choose from. The browser will use the first
recognized format.

• The text between the <audio> and </audio> tags will only be
displayed in browsers that do not support the <audio> element.
Code for Audio
<audio controls>
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio
element.
</audio>
The HTML <video> Element
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>

You might also like