HTML TEXT FORMATTING

Basic HTML Text Formatting

1. Headings

HTML provides six levels of headings (<h1> to <h6>) for creating titles and sub-titles.

headings

2. Paragraphs

Use the <p> tag for paragraphs.

para

3. Bold and Italic

You can make text bold or italic using the <b> and <i>tags, or use <strong>and<em> for semantic meaning.

bpld/italic

4. Underlined Text

The <u> tag can be used to underline text, though it's generally recommended to use CSS for styling.

Underlined

5. Superscript and Subscript

The <sup> and <sub> tags are used for superscript and subscript text.

supsub

6. Line Breaks and Horizontal Rules

Use <br> to insert a line break and <hr> for a horizontal rule.

break
Advanced Text Formatting with CSS

1. Font Properties

  • Font Family: Specify the font type.
  • Font Size: Set the size of the text.
  • Font Weight: Control the thickness of the text.
  • Font Style:Apply styles such as italic or oblique.
formattingfontpor

2. Text Color and Background Color

formattingtextcolorbgcolr

3. Text Alignment

  • Left, Right, Center, and Justify alignments can be set using the text-align property.
  • formattingtextcolorbgcolr

4. Text Decoration

  • Underline, Overline, Line-through
  • formattingtextdec

5. Text Transformations

  • Uppercase, Lowercase, Capitalize
  • formattingtexttransf