Mastering Text Formatting in HTML
Introduction: Intro to Text Formatting in HTML
Hello again! We're amping up our HTML game! Having seen the basic HTML structure, we'll now add flair with headers, paragraphs, and styles. We're delving into HTML text formatting!
You've encountered text formatting in books or articles: chapter titles, subheadings, or emphasized quotes that aid understanding. Similarly, HTML text formatting adds structure and expressiveness to your webpage.
Headers in HTML
HTML provides headings from <h1> to <h6>. The rule is simple: The lower the number, the larger the size the heading has. Hence, <h1> is the largest, and <h6> is the smallest heading.
Just as in a book, HTML headers can structure your webpage and guide the reader.
Working with Paragraphs
The <p> tag is used for paragraphs in HTML. Like in a book or letter, paragraphs make your content easier to read.
Dividing Code Into Sections
The <div> element in HTML is a block-level container that is used to group together and format sections of a document. It does not have a semantic meaning and is used to structure the content on the Web page. Check out the example below:
Text Formatting Tags
Dress up your text with HTML styles. The most common tags are <b> for bold, <i> for italic, and <u> for underline.
Text decorations can emphasize parts of your text and make your webpage more expressive.
Line Breaks and Horizontal Lines
Sometimes, you need to break a line or separate sections with a line. For these purposes, use the <br> tag for a line break and <hr> for a horizontal line.
