
In this article, we will see, Basic of HTML with examples.
Introduction:
HTML is HyperText Markup Language and is the language of the World Wide Web.
It is the standard text formatting language used for creating and displaying pages on the Web.
The definition of HTML is HyperText Markup Language. HyperText is the method by which you move around on the web — by clicking on special the text called hyperlinks which bring you to the next page.
The fact that it is hyper just means it is not linear — i.e. you can go to any place on the Internet whenever you want by clicking on links — there is no set order to do things in.
Markup means HTML tags mark it as a certain type of text. HTML completely relies on Tags.
Tags are labels you use to mark up the beginning and end of an element. There are two kinds of tags - opening tags: and closing tags:.
The only difference between an opening tag and a closing tag is the forward-slash "/". We label content by putting it between an opening tag and a closing tag.
HTML Versions:
Version |
Year |
HTML |
1991 |
HTML 2.0 |
1995 |
HTML 3.2 |
1997 |
HTML 4.01 |
1999 |
XHTML |
2000 |
HTML5 |
2014 |
HTML document structure:
<!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>Heading Tags</title> </head> <body> <h1>JavaTechSeries heading 1</h1> <h2>JavaTechSeries heading 2</h2> <h3>JavaTechSeries heading 3</h3> <h4>JavaTechSeries heading 4</h4> <h5>JavaTechSeries heading 5</h5> <h6>JavaTechSeries heading 6</h6> </body> </html> |
JavaTechSeries heading 1 JavaTechSeries heading 2 JavaTechSeries heading 3 JavaTechSeries heading 4 JavaTechSeries heading 5 JavaTechSeries heading 6 |
<!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>Paragraph</title> </head> <body> <p>Here is a first paragraph of text.</p> <p>Here is a second paragraph of text.</p> <p>Here is a third paragraph of text.</p> </body> </html> |
Here is a first paragraph of text. Here is a second
paragraph of text. Here is a third
paragraph of text. |
<!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>Line Break Example</title> </head> <body> <p> Hello<br> You are reading this HTML basic Tag.<br> Thanks in Advanced. </p> </body> </html> |
Hello |
<!DOCTYPE html> <html lang="en-US"> <head> <meta charset="ISO-8859-1"> <title>Lang Attribute Example</title> </head> <body> <h1>JavaTechSeries First Heading</h1> <p>JavaTechSeries first paragraph.</p>
</body> </html> |
JavaTechSeries First Heading
JavaTechSeries first
paragraph. |
5.2 title attribute:
This allows giving a title for the element. When you move the mouse over the element, the title will be displayed as a tooltip.
<!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>The title Attribute Example</title> </head> <body> <h3 title="Hello HTML!">Titled Heading Tag Example</h3> </body> </html> |
Titled
Heading Tag Example |
<a href=”https://javatechseries.blogspot.com”>
This is JavaTechSeries Link </a> |
5.4 align Tag: It is used to set the alignment of the tag content.
Example:
<!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>Align Example</title> </head> <body> <p align="left">JavaTechSeries is left aligned</p> <p align="center">JavaTechSeries is center aligned</p> <p align="right">JavaTechSeries is right aligned</p> </body> </html> |
Output:
JavaTechSeries is left aligned JavaTechSeries is center aligned JavaTechSeries is right aligned |
5.5 style Attribute: The style attribute allows you to specify the adding Style Sheet (CSS) rules within the element.
Example:
<!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>Style Attribute Example</title> </head> <body> <p style="font-family:arial; color:red;">Welcome
to Coder.....</p> </body> </html> |
Output:
This is JavaTechSeries HTML
Blog ... |
ConversionConversion EmoticonEmoticon