Format text with HTML
- 24-07-2022
- Trung Minh
- 0 Comments
In this article, I will show you how to format text using HTML tags.
From this article we start to learn the commonly used HTML tags, then we will apply CSS to build layouts to make the website more beautiful. The HTML tags I present are relatively simple, so you can use google to search for any programming blog.
Mục lục
1. Common Text Format HTML Tags
The following is a list of HTML tags used to format text.
Tag p – text segment
The p tag means paragrap , used to segment text in an essay. When writing, you must divide into paragraphs, each paragraph will be an idea or a group of many related ideas. This makes it a lot easier for others to read.
The example below I have divided into two paragraphs, running up you will see the space between the two paragraphs is separated by a blank line.
<p> Donec nibh urna, mattis nec lacinia egestas, volutpat quis risus. Morbi sagittis blandit cursus. Morbi in velit dui. Suspendisse aliquam porttitor tortor at tempus. Ut gravida, eros a porttitor ornare, quam mauris dignissim nisl, ac eleifend metus erat dignissim felis. </p> <p> Donec nibh urna, mattis nec lacinia egestas, volutpat quis risus. Morbi sagittis blandit cursus. Morbi in velit dui. Suspendisse aliquam porttitor tortor at tempus. Ut gravida, eros a porttitor ornare, quam mauris dignissim nisl, ac eleifend metus erat dignissim felis. </p>
Donec nibh urna, mattis nec lacinia egestas, volutpat quis risus. Morbi sagittis blandit cursus. Morbi in velit dui. Suspendisse aliquam porttitor tortor at tempus. Ut gravida, eros a porttitor ornare, quam mauris dignissim nisl, ac eleifend metus erat dignissim felis. Donec nibh urna, mattis nec lacinia egestas, volutpat quis risus. Morbi sagittis blandit cursus. Morbi in velit dui. Suspendisse aliquam porttitor tortor at tempus. Ut gravida, eros a porttitor ornare, quam mauris dignissim nisl, ac eleifend metus erat dignissim felis.
Card br – drop in line
Card br used to unload. If you use the br tag, the browser will move all the text starting after the br tag to a new row. The difference between the p tag and the br tag is that the br tag won't have too long a space between the two paragraphs, and the p tag does.
<p> Chào mừng bạn đến với <br/> web888.vn </p>
Chào mừng bạn đến với web888.vn
Tag b – bold
The b tag has the effect of bolding a paragraph. Its display use is the same as the strong tag.
<p> Chào mừng bạn đến với <b>web888.vn</b> </p>
Strong tag – emphasis
The strong tag has the same effect as the b tag, meaning it will highlight and highlight the paragraph. However, in terms of meaning, it is the emphasizing tag for the content.
<p> Chào mừng bạn đến với <strong>web888.vn</strong> </p>
Card i – italics
The i tag means Italic, has the effect of italicizing the text.
<p> Chào mừng bạn đến với <i>web888.vn</i> </p>
Small tag – small letters
The small tag is used to format text smaller than normal.
<p> Chào mừng bạn đến với <small>web888.vn</small> </p>
Tag – hightline
The mark tag is used to mark the hightline for the paragraph.
<p> Chào mừng bạn đến với <mark>web888.vn</mark> </p>
Card del – middle dash
The del tag is used to strike a line between paragraphs.
<p> Chào mừng bạn đến với <del>web888.vn</del> </p>
Sub tag – jump down
The sub tag is used to let the text jump below the paragraph.
<p> Chào mừng bạn đến với <sub>web888.vn</sub> </p>
sup card – jump on top
The sup tag is used to push the text to jump above the paragraph.
<p> Chào mừng bạn đến với <sup>web888.vn</sup> </p>
2. Simple exercises on formatting text in HTML
Let's compose an HTML code containing all the content of the tags that we learned in part 1. I'll let you guys practice. Or you can refer to the example below.
<p> Chào mừng bạn đến với website học lập trình <i>web888.vn</i> <br/> Đây là bài học <strong>các thẻ HTML định dạng văn bản</strong>, bạn hãy tham khảo và thực hành tất cả cá ví dụ nhé. </p> <p> Khi làm việc với văn bản thì chúng ta thường có những <b>thủ thuật riêng</b> để giúp đoạn văn nhìn trôi chảy hơn. </p>
Above are the tags commonly used to format text. In addition to these tags, we can use CSS instead and usually we use this way more often.
This article ends here, the next one we will learn about table format HTML tags.