HTML formatting refers to the process of applying visual styles, such as font size, color, alignment, and other presentational features, to the content of an HTML document. It involves using HTML tags and CSS (Cascading Style Sheets) to structure and style the text and other elements on a web page.

Here are some common HTML formatting techniques:

 

Text Styling: HTML provides various tags to format text, including:

 

 

  • <b> or <strong>: Bold text.
  • <i> or <em>: Italicized text.
  • <u>: Underlined text.
  • <s> or <del>: Strikethrough text.
  • <sup>: Superscript text.
  • <sub>: Subscript text.

<p>This is <b>bold</b> and <i>italic</i> text.</p>

Headings: HTML offers six levels of headings, ranging from <h1> to <h6>. Headings provide semantic structure and visual hierarchy to the content.

Example:

<h1>Main Heading</h1>
<h2>Subheading</h2>

Paragraphs and Line Breaks: The <p> tag is used to create paragraphs, while the <br> tag inserts a line break within a paragraph.

Example:

<p>This is the first paragraph.</p>
<p>This is the second paragraph.</p>
<p>This is a line<br>break.</p>

Lists: HTML supports ordered and unordered lists to present information in a structured format. Example:

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

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

Blockquotes: The <blockquote> tag is used to indicate quoted content, visually setting it apart from the surrounding text.

Example:

<blockquote>
  <p>This is a blockquote.</p>
</blockquote>

Preformatted Text: The <pre> tag preserves the formatting and spacing of text as it appears in the HTML source code.

Example:

<pre>
  This is some
  preformatted
  text.
</pre>

Latest Tutorial

Newly published tutorials

Laravel - How to upload file to AWS S3 Bucket

Explore how we can upload file using the laravel on Amazon S3 bucket.

Laravel 10 - Tutorial to create CRUD Application

Learn to create crud application using laravel 10. Step by step guidance will help to understand the concept of crud.

Laravel 10 - Send mail using AWS SES

Learn to send Email using Laravel 10 with AWS SES service.