Learning HTML Part 7 : How To Create Paragraphs in HTML (tag p)

0

Learn HTML tutorial at this time we are going to discuss the paragraph tag, how writing a paragraph tags and how to create paragraphs in HTML.

To understand how making the paragraphs in HTML, we will use an example HTML structure created on a tutorial before this, and add some text. Please reopen text editor, and then type the following code:

An example of a paragraph tag:

Save as paragraphs.html, and run in a web browser.

See the Pen How To Create Paragraphs in HTML (tag p) by webspoints (@webspoints) on CodePen.

We will see that the paragraph does not reside on a different line, but are on the same line. In HTML, whitespace is ignored, including if we change it to:

An example of a paragraph tag 2:

We have to tell the web browser that both sentences were to be separate. And that each sentence it is a paragraph.

Tag Paragraf (<p>)

HTML provides a special tag to make paragraphs. It was written using the letter p, as follows: <p>. Let’s have a revision of the previous HTML code examples, and added tags <p>.

An example of a tag paragraph 3:

See the Pen Tag Paragraf by webspoints (@webspoints) on CodePen.

So this time we will see that these two paragraphs that already are at their respective positions. Every paragraph tag, web browsers will provide extra space between paragraphs.

Tag Break (<br>)

Another way to separate the two paragraphs is to use tags <br> (br stands for break).

Example of using the tag <br>:

If the HTML code above is executed, then the result is almost the same as using tags<p>. But the separation of paragraphs using tags<br>is not to make paragraphs. Tag<br>function to separate a section of text with other text. If we need is structure paragraphs, then use the tag <p>.

Tags for thickening and slashes (<em> and <strong>)

In a paragraph, sometimes we need to make emphasis on certain words. This emphasis can be done with words, or thicken it with a slash.

Emphasis (emphasis) tag consists of two tags, <em> for emphasis, and <strong> for strong emphasis.

In General, most web browsers will display <em> as a slash, and <strong>with the thickening of the letters.

Example of using the tag <em> and <strong>:

See the Pen Tag for Thickening and slashes by webspoints (@webspoints) on CodePen.

Although the sign space will not be considered to be in HTML, but to make the HTML code, (indent) a few lines in a tag will make the code easier to read.

After you understand how making the paragraphs in HTML, at the next tutorial, we’ll learn Learning HTML Part 8 : How to Make a Title/Headings in HTML (h1 tag).

LEAVE A REPLY

Please enter your comment!
Please enter your name here