Explain HTML Formatting
HTML (HyperText Markup Language) formatting refers to the use of tags to provide layout and style to text on webpages. This formatting includes elements like headings, paragraphs, links, images, lists, tables, and more.
The HTML formatting tags are included inside the <>
<body>
<tag-name>Text</tag-name>
</body>
Let's take a look at some of the most common HTML formatting tags and their uses:
-
Heading Tags
Heading tags are used to define the headings in HTML documents. They range from h1 to h6, with h1 being the largest and h6 being the smallest.
<h1>Heading 1</h1> <h2>Heading 2</h2> <h3>Heading 3</h3> <h4>Heading 4</h4> <h5>Heading 5</h5> <h6>Heading 6</h6> -
Paragraph Tags
The <p> tag is used to define a paragraph.
<p>This is a paragraph.</p> -
Line Break
The <br> tag is used to insert a line break. Note that it's an empty tag, meaning it doesn't have a closing tag.
<p>Line 1<br>Line 2</p> -
Bold Text
The <b> tag is used to create bold text.
<b>This is bold text.</b> -
Italic Text
The <i> tag is used to create italicized text.
<i>This is italic text.</i> -
Underlined Text
The <u> tag is used to create underlined text.
<u>This is underlined text.</u> -
Images
The <img> tag is used to include images on the webpage. You have to use the 'src' attribute to specify the image source.
<img src="myImage.jpg" alt="My Image"/> -
Links
The <a> tag is used to create hyperlinks. The 'href' attribute is used to specify the link's destination.
<a href="https://www.example.com/">Visit Example.com</a> -
Lists
HTML supports ordered (numbered), unordered(bulleted), and definition lists.
Unordered
<ul> <li>Apple</li> <li>Banana</li> </ul>Ordered
<ol> <li>First item</li> <li>Second item</li> </ol>Definition list
<dl> <dt>HTML</dt> <dd>HyperText Markup Language</dd> </dl> -
Tables
HTML tables are defined with <table>, a row with <tr>, header cell with <th> and data cell with <td>.
<table> <tr> <th>Firstname</th> <th>Lastname</th> </tr> <tr> <td>Jane</td> <td>Doe</td> </tr> </table>
Your Feedback
Help us improve by sharing your thoughts
Online Learner helps developers master programming, database concepts, interview preparation, and real-world implementation through structured learning paths.
Quick Links
© 2023 - 2026 OnlineLearner.in | All Rights Reserved.
