0% found this document useful (0 votes)
2 views4 pages

HTML Part1

HTML, created by Tim Berners-Lee in 1991, is a markup language used to structure web documents, with the current version being HTML5 released in 2012. It utilizes tags to format content, including essential tags like <html>, <head>, <body>, <h1>, and <p>, which help browsers display the document correctly. The <!DOCTYPE html> declaration is crucial as it informs the browser of the HTML version used in the document.

Uploaded by

Rahul Das
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views4 pages

HTML Part1

HTML, created by Tim Berners-Lee in 1991, is a markup language used to structure web documents, with the current version being HTML5 released in 2012. It utilizes tags to format content, including essential tags like <html>, <head>, <body>, <h1>, and <p>, which help browsers display the document correctly. The <!DOCTYPE html> declaration is crucial as it informs the browser of the HTML version used in the document.

Uploaded by

Rahul Das
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

HTML (HyperText Mark up Language)

 HTML was created by Tim Berners-Lee in 1991.


 The current version of HTML is HTML 5 (released in 2012).
 HTML is not a programming language (it does not have arithmetic and logic
capabilities, it can only structure a document).
 HTML is case insensitive.

Why HTML is called Mark up language?


Ans: HTML is called a Mark-up language because we can simply use HTML to
“Mark-up” a text document with tags and tell the web browser how to display it.
Initially HTML was developed to define structure of a document like headings,
paragraphs, list, table etc but now we use it to design web pages.

What is the use of <!DOCTYPE html> in HTML?


Ans: The <!DOCTYPE html> declaration tag is used by the web browser to
understand the version of the HTML used in the document. The <!DOCTYPE>
declaration must be the very first line of a HTML document, if the very first line is
not a <!DOCTYPE> declaration then our web browser will fail to recognize which
version of HTML we are using.
A Sample HTML document

HTML Code 1
Output 1
Tags used in the above HTML document are:

 <html> tag: This tag encloses the complete HTML document and mainly
comprises of document header which is represented by <head>...</head>
and document body which is represented by <body>...</body> tags.
 <head> tag: The <head> tag is used to add meta information to your
webpage that will be used by the browser.
 <title> tag: The <title> tag is used inside the <head> tag to mention the
document title.
 <body> tag: This tag represents the document's body which keeps other
HTML tags like <h1>,<p> etc. The content of the body tag are viewed by
the user when they open the website.
 <h1> tag represents heading and <p> tag represent paragraph.

Heading Tags:
Any document starts with a heading. You can use different sizes for your headings.
HTML also has six levels of headings, which use the elements <h1>, <h2>, <h3>,
<h4>, <h5>, and <h6>. While displaying any heading, browser adds one line
before and one line after that heading.

HTML Code 2
Output 2
Paragraph Tag: The <p> tag offers a way to structure your text into different
paragraphs. Each paragraph of text should go in between an opening <p> and a
closing </p> tag.

Line Break Tag: Whenever you use the <br /> element, anything following it
starts from the next line. This tag is an example of an empty element, where you
do not need opening and closing tags, as there is nothing to go in between them.

Horizontal Line Tag: Horizontal lines are used to visually break-up sections of a
document. The <hr> tag creates a line from the current position in the document to
the right margin and breaks the line accordingly.

This figure shows the use of <br> and <hr> tag

Output:
What are tags in HTML?

Ans: HTML tags are like keywords which define that how web browser will
format and display the content. With the help of tags, a web browser can
distinguish between an HTML content and a simple content. HTML tags contain
three main parts: opening tag, content and closing tag. But some HTML tags are
unclosed tags.

When a web browser reads an HTML document, browser reads it from top to
bottom and left to right. HTML tags are used to create HTML documents and
render their properties. Each HTML tags have different properties.

An HTML file must have some essential tags so that web browser can differentiate
between a simple text and HTML text. You can use as many tags you want as per
your code requirement.

 All HTML tags must enclosed within < > these brackets.
 Every tag in HTML perform different tasks.
 If you have used an open tag <tag>, then you must use a close tag </tag>
(except some tags)

Syntax: <tags>Content</tags>

There are 2 types of tags:

1. Container Tags: The container tags are tags that have some content between
their opening and closing tags.

Some examples are the <html>, <head>, and <body> tags.

2. Empty Tags: The empty tags are also called void tags sometimes. They are self-
closing tags like <img />, <br />, <input /> tags. They do not have any content
between them.

You might also like