Make Money Online HTML PHP JAVASCRIPT HTML TUTORIAL FOR BEGINNERS 3/12: Headings, Paragraph, span, line break and horizontal rule

HTML TUTORIAL FOR BEGINNERS 3/12: Headings, Paragraph, span, line break and horizontal rule

HTML TUTORIAL FOR BEGINNERS 3/12: Headings, Paragraph, span, line break and horizontal rule post thumbnail image


In this HTML tutorial for beginners, we will learn about headings, paragraphs, span, line break and horizontal rule.

Headings

Headings are used to structure the document and indicate its hierarchy. There are six levels of headings from h1 to h6. The h1 heading is the most important and the h6 heading is the least important.

Paragraphs

A paragraph is a block of text that is usually used to represent a single idea. Paragraphs are usually denoted by a p tag.

Span

The span element is used to group inline elements together. The span element does not have any semantic meaning. It is often used with the class attribute to style specific elements. For example, if we want to make all the letters in a paragraph red, we can use the following CSS code: p span { color: red; }

Line break

The line break element is used to insert a line break between two elements. The line break element is empty, it does not have a closing tag and it only takes effect when it is used within block-level elements such as paragraphs or headings. For example:

Heading 1

This is a paragraph.

This is another paragraph.

In the above code, we have two paragraphs that are each represented by a p tag. By default, the browser will display each paragraph on a new line. However, if we want to display the paragraphs on the same line, we can use the line break element like this:

Heading 1

This is a paragraph.
This is another paragraph.

Notice that we have added a br tag between the two paragraphs. This will cause the browser to display the paragraphs on the same line. Horizontal rule The horizontal rule element is used to insert a horizontal rule into the document. The horizontal rule element is empty, it does not have a closing tag and it only takes effect when it is used within block-level elements such as paragraphs or headings. For example:

Heading 1


This is a paragraph.

In the above code, we have inserted a horizontal rule after the heading element. This will cause the browser to display a horizontal line below the heading.

Related Post