HTML Formatting

In HTML, you can use various formatting elements and tags to structure and format your content. Here are some commonly used formatting elements in HTML:


1. Headings:

HTML provides six levels of headings, from `<h1>` to `<h6>`, where `<h1>` represents the highest level and `<h6>` represents the lowest level. Headings are used to give semantic structure to your content and help define the hierarchy of information on your webpage. For example:


html
<h1>This is a Heading level 1</h1>
<h2>This is a Heading level 2</h2>
<h3>This is a Heading level 3</h3>


2. Paragraphs:

Paragraphs can be represented using the `<p>` tag. They are used to enclose and format blocks of text. For example:

html
<p>This is a paragraph.</p>


3. Lists:

HTML provides two types of lists: ordered lists (`<ol>`) and unordered lists (`<ul>`).

- Ordered List:
An ordered list represents a list of items in a specific order, typically using numbers. Each list item is represented by the `<li>` tag. For example:

html
<ol>
    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3</li>
</ol>

- Unordered List:
An unordered list represents a list of items without any specific order, typically using bullet points. Each list item is represented by the `<li>` tag. For example:

html
<ul>
    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3</li>
</ul>

4. Text Formatting:

HTML provides several tags to format text within paragraphs or headings. Some commonly used formatting tags include:

- `<strong>` or `<b>`: Bolds the text.
- `<em>` or `<i>`: Italicizes the text.
- `<u>`: Underlines the text.
- `<s>`: Strikes through the text.
- `<sup>`: Renders the text as superscript.
- `<sub>`: Renders the text as subscript.


For example:

html
<p>This is <strong>bold</strong> text and <em>italic</em> text.</p>


5. Line Breaks:

To insert line breaks within a paragraph, you can use the `<br>` tag. For example:

html
<p>This is the first line.<br>This is the second line.</p>


These are just a few of the many formatting elements and tags available in HTML. You can combine them to structure and format your content according to your needs.



About the Author



Silan Software is one of the India's leading provider of offline & online training for Java, Python, AI (Machine Learning, Deep Learning), Data Science, Software Development & many more emerging Technologies.

We provide Academic Training || Industrial Training || Corporate Training || Internship || Java || Python || AI using Python || Data Science etc





 PreviousNext