HTML Full Course (Day 03) - Noob Coder

Thursday, July 20, 2023

HTML Full Course (Day 03)

1. Headings (h1-h6):

HTML provides six levels of headings, from `<h1>` to `<h6>`, which represent different levels of importance and hierarchy in the document. Here's how they are typically used:

- `<h1>` represents the highest level heading and is used for the main title of the page.

- `<h2>` to `<h6>` represent lower-level headings and are used for subheadings or sections within the page. `<h2>` is the second-level heading, `<h3>` is the third level, and so on.

The headings provide a structured outline of the document, helping both users and search engines understand the organization and importance of different sections.

2. Paragraphs (p):

The `<p>` tag is used to enclose paragraphs of text. It is the standard way to mark up blocks of textual content. For example:

```html

<p>This is a paragraph of text.</p>

<p>This is another paragraph.</p>

```

By using `<p>` tags, you indicate to browsers and assistive technologies that the enclosed content represents a distinct paragraph.

3. Text formatting tags (bold, italic, underline):

HTML provides tags for applying basic text formatting:

- `<b>` or `<strong>`: 

The `<b>` tag and its semantic equivalent `<strong>` are used to apply bold formatting to text. For example, `<b>Bold text</b>` or `<strong>Important text</strong>`.

- `<i>` or `<em>`: 

The `<i>` tag and its semantic equivalent `<em>` are used to apply italic formatting to text. For example, `<i>Italic text</i>` or `<em>Emphasized text</em>`.

- `<u>`:

The `<u>` tag is used to underline text. For example, `<u>Underlined text</u>`.

These tags provide a way to add basic formatting to text content. However, it is recommended to use CSS for styling purposes instead of relying solely on these tags.

4. Line breaks (br) and horizontal lines (hr):

HTML offers tags to insert line breaks and horizontal lines:

- `<br>`: 

The `<br>` tag creates a line break, which forces text or elements to start on a new line. It does not require a closing tag. For example, `<p>This is a line<br>break.</p>`.

- `<hr>`: 

The `<hr>` tag inserts a horizontal rule, a horizontal line that visually separates content sections. It can be used to create visual divisions or breaks between sections. For example, `<p>Some content</p><hr><p>More content</p>`.

These tags are used to add visual separation or line breaks within the text content of an HTML document.

By utilizing headings, paragraphs, text formatting tags, line breaks, and horizontal lines, you can structure and format your text content in a clear and visually appealing manner within HTML documents.

No comments:

Post a Comment