What is HTML?
HTML stands for HyperText Markup Language.If we look at the first part, hypertext, what does that mean?
It refers to the pieces of text which can link to other documents in the website.
So these pieces of text are hypertext or hyperlinks, and they are the foundation of how an HTML website works.
what about the the markup language?
What is a markup language?
The presence of the quotation marks is what tells a user that this part is a quotation.Observe the below line
"This is a Quotation"
Likewise we use to mark some words up and show differently, such as bold, underline, heading.
How do we do markup with HTML?
It's done by using HTML tags.
The basic and important tags are headings <h1> through to <h6> and the paragraph <p> tag.
The Heading Element
<h1> This is Heading Tag</h1>
This is what a heading element looks like.
It starts off with an opening tag here, and it ends with a closing tag.
Now, if you look closely, the opening and the closing tag actually have one thing that's different,
and it's the forward slash in closing tag. That is what makes this a closing tag.
what goes in between these two tags is the content of that particular HTML element.
HTML defines the content and structure of the website.
What's the difference between HTML element and HTML tag?
Tags are nothing but <h1>, <b>, <i> ,</h2>
Elements are the total that includes the content as well as opening and closing tags if any.
Example of an HTML program:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
The structure of HTML starts with <!DOCTYPE html> which tells the browser about the version of HTML.
<html> tag is the starting tag of HTML and end tag of the HTML file is </html>
The <body> tag where the actual HTML document starts. The content which is between <body> and </body> is shown as a web page in the browser.The <head> tag is used to maintain the meta tags of the HTML file. Which tells about the file. The title of the file is displayed at the browser tab.
<head>
<title>Page Title</title>
</head>
HTML - Basic Tags
The basic tags of HTML are <h1>, <h2>, <h3>, <h4>, <h5>, and <h6> which are used to display the content in different sizes respectively.The output of the above program is:<!DOCTYPE html>
<html>
<head>
<title>Heading Example</title>
</head>
<body>
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
<h5>This is heading 5</h5>
<h6>This is heading 6</h6>
</body>
</html>
This is heading 1
This is heading 2
This is heading 3
This is heading 4
This is heading 5
This is heading 6
The Paragraph Tag <p> </p>
The <p> tag displays the content as paragraph. we have to use <p> </p> tags for every individual paragraphs.The output is as follows:<!DOCTYPE html>
<html>
<head>
<title>Paragraph Example Program</title>
</head>
<body>
<p>This is a first paragraph.</p>
<p>This is a second paragraph.</p>
<p>This is a third paragraph.</p>
</body>
</html>
This is a first paragraph.
This is a second paragraph.
This is a third paragraph.