It never hurts to learn new things. AND The HTML language, despite the fact that it is not used as much now as it was a few years ago, is still one of the main ones in the creation of web pages. So if you're a page designer, knowing how to bold, italicize, and underline HTML is something you need to master.
But do you know how to do it? If not, then we are going to give you a small tutorial so that you do not have any problem doing it. Surely it is good for you to refresh knowledge or learn something new. Shall we start?
How to make bold, italic and underline in HTML: the tags
The first thing you should know about HTML that interests you is the so-called tags. They are a tool that allows you to create different "types" of letters, such as italics, strikethrough, bold, underline... Learning these labels will take up a lot of time.
And it is that, with them, you have half the knowledge, the other half being only the practice when putting them on.
You will see.
Make HTML bold
Imagine that you have a text and you want a word to be highlighted. From the previous sentence, we want “text” to be highlighted. And to put bold you use HTML (because it is a web).
So you have to know what is the tag corresponding to the bold in HTML. In this case, the label is .
Now, it is not about putting it at the beginning of the text and that's it. Not at the end either. You have to place it next to the word or group of words that you want to put in bold. And you should always close it with the tag closed, that is, .
To make it clearer to you:
Imagine that you have a text and you want a word to be highlighted.
It would be wrong because we tell HTML that all that sentence is in bold. But also the next, and the next, and the next, because there's no closing tag.
Imagine that you have a text and you want a word to be highlighted.
In this case it is as if the next word or phrase that is written is going to be the one that is put in bold.
Imagine that you have a text and you want a word to be highlighted.
Also common to find it, but in reality it is useless. And it is that between those two tags there is no phrase or word, so they are canceled without putting anything in bold.
Imagine that you have a text and you want a word to be highlighted.
Here it would be "almost" fine. And it is that from text, everything else that is written will come out in bold.
Imagine that you have a text and you want a word to be highlighted.
This would be the correct way to put bold in HTML.
Put italics in HTML
You already have mastered the bold. So we go to italics. And again we find the same thing. There is a specific tag to achieve this in HTML. We talk about
As with bold, you have to have an opening tag, which would be , and a closing tag, in this case .
Using the same examples as before, you put cases that will not be fine and the one that is.
Imagine that you have a text and you want a word to be highlighted.
It would be wrong because we tell HTML that that whole sentence is italicized. As well as the next, and the other, and the other. Since there is no closing tag, it does not know when to stop putting it.
Imagine that you have a text and you want a word to be highlighted.
In this case what we say to this language is that the following word or phrase will be italicized. But if we do not put the closing tag, it will happen with the previous example.
Imagine that you have a text and you want a word to be highlighted.
The same thing happens with the bold ones. Since there is nothing between those two labels, they are canceled without italicizing anywhere. Be careful, because you would have garbage code that does not work.
Imagine that you have a text and you want a word to be highlighted.
Here it would be "almost" fine. It will italicize the word text, but since it does not have a closing it will continue with italics until you stop writing.
Imagine that you have a text and you want a word to be highlighted.
This would be the correct way to italicize in HTML.
Put underline in HTML
Finally we have the underscore. In this case, the label you need to know is . Anything you write between the opening and closing will be underlined (even if you, in the code, can't see it).
It is not recommended to use it because it is often confused with a link, which, as you know, appears underlined and in a different color on the pages. What can make many users want to enter the page and cannot (giving a bad image).
That is why it is only reserved for sporadic occasions.
Here we leave you examples following the same previous sentence.
Imagine that you have a text and you want a word to be highlighted.
By putting it at the beginning of the sentence we tell it that it will go all underlined. However, if the closing tag is not placed, it will continue to underline everything else that is written.
Imagine that you have a text and you want a word to be highlighted.
Although it may be placed well for the next sentence, you will not get the word text to be underlined because it is not in the correct place.
Imagine that you have a text and you want a word to be highlighted.
In this case these labels thus cancel each other out. And since there are no words or phrases put between them they won't underline anything.
Imagine that you have a text and you want a word to be highlighted.
Almost. It will underline the word text. But also the rest of the words and phrases because it lacks the closing tag.
Imagine that you have a text and you want a word to be highlighted.
This would be the correct way to place underscore in HTML.
Are you clear on how to bold, italicize, and underline in HTML? Do you have any doubts? Leave them to us in comments and we will give you a hand.