HTML Comments Heading Formatting Text
HTML For Beginners To Master The Easy Way: Start Learning HTML
Our HTML tutorial material is developed for beginners to Master Level Programmer up to project level. In our tutorial, each and every topic is given step-by-step so that you can learn it in a very easy way. You need not to search for more information.
CHAPTER - 2
Introduction to HTML Tags
HTML tags are divided into two types:
1. Paired Tag
2. Singular Tag
Paired Tags
HTML tag is known as a paired tag form when the tag consists of an opening tag and a closing tag as its companion tag. HTML Paired tag starts with an opening tag: the tag name enclosed inside the angle brackets.
A bold opening tag is written as <b> and closing bold tag is written as </b>
Example 1:
<b> Bold text </b>
Singular Tags
HTML tag is called an singular tag when the tag only has an opening tag and does not have a closing tag or a companion tag. The singular HTML tag does not require a closing tag. It is also called Standalone Tags.
Example:
<hr>
HTML Comments
The comment tag (<!– Comment –>) is used to hide the typed text that the programmer does not want to display. It is a good practice of coding so that coder and the reader can get help to understand the code. It is helpful to understand the complex code. The comment tag is useful during the debugging of codes.
· It is a simple piece of code that is ignore by web browsers will not be displayed by the browser.
· It is a description about the command that programmer on the spot writes .that helps him at the time debugging.
Types of HTML Comments: There are three types of comments in HTML which are:
· Single-line comment
· Multi-lines comment
Syntax for single the comment :
HTML Code :
<!DOCTYPE html>
<html>
<body>
<!--This is heading Tag -->
<h1>Aastha Information </h1>
<!--This is single line comment -->
<h2>This is single line comment</h2>
</body>
</html>
Syntax for Multi-line comment: (<!– –>).
HTML Code :
<!DOCTYPE html>
<h2>This is multi-line comment</h2>
HTML Headings: These Heading tags help us to give headings to the content of HTML webpage. These tags are mainly written inside the body tag. These 6 heading elements are H1, H2, H3, H4, H5, and H6; with H1 being the highest level (Bigger in size) and H6 the least(smallest in size).
Example: Syntax for Heading Tags in HTML.
<!DOCTYPE html>
<html>
<head>
<title>Heading Tags text </title>
</head>
<body>
<h1>H1 Aastha Information<h1>
<h2>H2 Aastha Information </h2>
<h3>H3 Aastha Information </h3>
<h4>H4 Aastha Information </h4>
<h5>H5 Aastha Information </h5>
<h6>H6 Aastha Information </h6>
</body>
</html>
The Output of the code is :
HTML Paragraph
The HTML <p>
element defines a paragraph.
A paragraph always starts on a new line, and browsers add some white space (a margin) before and after a paragraph. These have both opening and closing tags. So anything mentioned within <p> and </p>.
HTML Formatting
HTML Formatting is a process of formatting text for different look or to highlight text. HTML provides us ability to format text without using CSS. There are many formatting tags in HTML. These tags are used to make text bold, italicized, or underlined lot more.
1. Bold Tag:
Anything that appears within <b>...</b> element, is displayed in bold form.
2. Underlined Tag:
Anything that appears within <u>...</u> element, is displayed with underline form.
3. Italic Tag:
Anything that appears within <i>...</i> element is displayed in italicized form.
4. Strike Tag:
Anything that appears within <strike>...</strike> element is displayed with strikethrough, which is a thin line through the text
5. Monospaced Font Tag: (Teletype)
The content of a <tt>...</tt> element is written in monospaced font.
6. Superscript Tag:
The content of a <sup>...</sup> element is written in superscript; the font size used is the same size as the characters surrounding it but is displayed half a character's height above the other characters. Mainly used in math and science equations.
7. Subscript Tag:
The content of a <sub>...</sub> element is written in subscript; the font size used is the same as the characters surrounding it, but is displayed half a character's height beneath the other characters. Mainly used in math and science equations.
8. Inserted Tag:
Anything that appears within <ins>...</ins> element is displayed as inserted text.
9. Del tag(Deleted Text)
Anything that appears within <del>...</del> element, is displayed as deleted text.
10. Big tag:
The content of the <big>...</big> element is displayed one font size larger than the rest of the text surrounding it as shown below −
11. Smaller Tag:
The content of the <small>...</small> element is displayed one font size smaller than the rest of the text surrounding it as shown below −
12. Emphasis tag:
The contents of <em>….</em>elements is displayed renders as emphasized text.
13. KBD tag:(Keyboard Input Element)
The <kbd> HTML element represents a span of inline text denoting textual user input from a keyboard, voice input, or any other text entry device.
Note : <br> Tag is used to break the line. If you don't put <br> Tag at the end of the line the output will be in a single line.You can try without using <br> tag and then check the output.
Blog Disclaimer :
Post a Comment