HTML tags can be marked at the beginning and end of HTML elements and have contained attributes. The HTML tags contain elements are provide instruction for how information will be processed and display in the view page.
Know some HTML basic tags:
Heading tag:
HTML defines six levels of heading tags. You can use different size of heading in you page using six level of heading tags. The heading tags are <h1>, <h2>, <h3>, <h4>, <h5>, and <h6>.
- HTML document start with a heading,
- HTML <h1> to <h6> tags are used to define HTML page headings,
- Html <h1> tag defines the most important heading and <h6> tag defines the least important heading.
<!DOCTYPE html> <html> <head> <title>My Page Title</title> </head> <body> <h1>My page heading 1</h1> <h2>My page heading 2</h2> <h3>My page heading 3</h3> <h4>My page heading 4</h4> <h5>My page heading 5</h5> <h6>My page heading 6</h6> </body> </html>
A HTML heading element implies all the font changes, paragraph breaks before and after, and any white space necessary to render the heading.
Paragraph tag:
HTML paragraph tag are represents a paragraph of text elements. The paragraph tag begins with <p> tag and ends with the </p> tag. In HTML paragraphs are usually represented in display media as blocks of text.
- HTML paragraph tag gives a way to structure of text,
- HTML paragraph tag gives way to split up text into more manageable.
<!DOCTYPE html> <html> <head> <title>My Page Title</title> </head> <body> <p>Dear Sir,</p> <p>I beg most respectfully and request you that I could not attend school from the 7 th to the 9 th instant on account of fever.</p> <p>May I , therefore, pray and hope that you would be kind enough to grant me leave of absence for those days only.</p> </body> </html>
Line break tag:
HTML break tag use to insert a single line break and character start from the next line. HTML break tag star with <br/> but it’s not have end tag. When you use the <br /> tag, the text starts from the next line.
- HTML <br/> tag is call an empty tag,
- HTML break tag not need opening and closing tags,
- Break tag is useful for writing an address.
<!DOCTYPE html> <html> <head> <title>My Page Title</title> </head> <body> To<br/>The headmaster<br/>Gangore high School<br/>Niamatpur,Naogaon<br/>Subject: Prayer for leave of absence </body> </html>
HTML center tag:
HTML center tag use to put any content in the center of the page. The elements are centered horizontally. HTML center tag is begins with <center> tag and end with </center> tag.
The <center> tag is use to identify text that should be center when render by a browser. Use center tag text may be centered, but you would be better off using CSS to center text, correct way to center-align.
<!DOCTYPE html> <html> <head> <title>My Page Title</title> </head> <body> <center>In the following example, the HTML center tag use to put any content in the center of the web page</center> </body> </html>
Notice: The <center> tag is not supported in HTML5.
Horizontal Line tag:
HTML horizontal lines tag is used to visually break-up sections of a HTML page document. The horizontal line tag is start with <hr> tag, but it not has end tag.
- The <hr/> tag defines for document break in an HTML page.
- You can give a line below of letter heading or give line between two paragraphs.
- The <hr/> tag defines a thematic break in HTML 5.
- HTML <hr/> tag is call an empty tag, because it has no end tag.
<!DOCTYPE html> <html> <head> <title>Horizontal Line tag</title> </head> <body> <center>My Letter Heading</center> <hr> </body> </html>
HTML <iframe> Tag:
The HTML <iframe> tag represents a nested browsing context. It is the completely step-by-step tutorial on creating frames for your web page.
- HTML <iframe> tag specifies an inline frame.
- HTML <iframe> tag embedding another HTML page into the current page.
<!DOCTYPE html> <html> <head> <title>HTML iframes</title> </head> <body> <iframe src="http://datainflow.com/programming/"> <p>The browser does not support iframes.</p> </iframe> <hr> </body> </html>
HTML < iframe> tag allows you to display an HTML document inside another HTML document with an inline frame is used to embed another document within the current HTML document.
Preserve formatting:
HTML preserve formatting represents with <pre> tag. HTML <pre> tag is used for indicating preformatted a document texts. Preserve formatting begins with <pre> tag and end with </pre> tag. In HTML you will preserve the formatting of the source document text between the opening <pre> tag and the closing </pre> tag.
- The HTML<pre> tag is supports the Global Attributes in HTML.
- The HTML <pre> tag is defines preformatted text document.
- HTML <pre> tag is show the exact format of written code in the HTML document.
<!DOCTYPE html> <html> <head> <title>HTML preserve formatting</title> </head> <body> <pre> jQuery(document).ready(function() { Main.init(); FormValidator.init(); UINotifications.init(); $('.datepicker').datepicker({ autoclose: true, todayHighlight: true }); }); </pre> </body> </html>
Whatever, you want to show the exact format of your written format in your HTML document. That’s like any another language show in HTML document with its exact format use <pre> tag.
Non-breaking space:
The non-breaking space is represented with “ ”, it is a common character entity that used in HTML document. It is use in HTML get a non-breaking space. In HTML a non-breaking space is a space that will not break into a new line.
It as ordinary space character gets a single space in the text line without break a new line in HTML document.
In cases, you want to show (nationality: India) this text that format. you should use a non-breaking space.
For Example:
<!DOCTYPE html> <html> <head> <title>HTML pre tag</title> </head> <body> <p>nationality: India</p> </body> </html>