HTML
HTML stands for Hypertext Markup Language, and it is the most widely used language to write Web Pages.- Hypertext refers to the way in which Web pages (HTML documents) are linked together. Thus, the link available on a webpage is called Hypertext.
- As its name suggests, HTML is a Markup Language which means you use HTML to simply "mark-up" a text document with tags that tell a Web browser how to structure it to display.
Now, HTML is being widely used to format web pages with the help of different tags available in HTML language.
Applications of HTML
As mentioned before, HTML is one of the most widely used languages over the web. I'm going to list a few of them here:
- Web pages development - HTML is used to create pages which are rendered over the web. Almost every page of web is having HTML tags in it to render its details in the browser.
- Internet Navigation - HTML provides tags which are used to navigate from one page to another and is heavily used in internet navigation.
- Responsive UI - HTML pages nowadays work well on all platform, mobile, tabs, desktop or laptops owing to responsive design strategy.
- Offline support HTML pages once loaded can be made available offline on the machine without any need of internet.
- Game development- HTML5 has native support for rich experience and is now useful in gaming development arena as well.
Basic HTML Document
In its simplest form, following is an example of an HTML document −<!DOCTYPE html> <html> <head> <title>This is document title</title> </head> <body> <h1>This is a heading</h1> <p>Document content goes here.....</p> </body> </html>
HTML Tags
As told earlier, HTML is a markup language and makes use of various tags to format the content. These tags are enclosed within angle braces <Tag Name>. Except few tags, most of the tags have their corresponding closing tags. For example, <html> has its closing tag </html> and <body> tag has its closing tag </body> tag etc.Above example of HTML document uses the following tags −
Sr.No | Tag & Description |
---|---|
1 | <!DOCTYPE...>
This tag defines the document type and HTML version. |
2 | <html>
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. |
3 | <head>
This tag represents the document's header which can keep other HTML tags like <title>, <link> etc. |
4 | <title>
The <title> tag is used inside the <head> tag to mention the document title. |
5 | <body>
This tag represents the document's body which keeps other HTML tags like <h1>, <div>, <p> etc. |
6 | <h1>
This tag represents the heading. |
7 | <p>
This tag represents a paragraph. |
World Wide Web Consortium (W3C) recommends to use lowercase tags starting from HTML 4.
HTML Document Structure
A typical HTML document will have the following structure −<html> <head> Document header related tags </head> <body> Document body related tags </body> </html>We will study all the header and body tags in subsequent chapters, but for now, let's see what is document declaration tag.
The <!DOCTYPE> Declaration
The <!DOCTYPE> declaration tag is used by the web browser to understand the version of the HTML used in the document. Current version of HTML is 5 and it makes use of the following declaration −<!DOCTYPE html>
There are many other declaration types which can be used in HTML document depending on what version of HTML is being used. We will see more details on this while discussing <!DOCTYPE...> tag along with other HTML tags.HTML - Basic Tags
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.Example
<!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>
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 as shown below in the example −Example
<!DOCTYPE html> <html> <head> <title>Paragraph Example</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>
No comments:
Post a Comment