Formatting Text with HTML
Page 5 | Listen in audio
Text formatting is one of the main functions of HTML, allowing developers to create visually appealing and well-organized web pages. Through HTML tags, it is possible to format the text in several ways, such as changing the font size, text color, adding bold, italics, underlining, among other options.
To change the font size, for example, we can use the tag and specify the desired size through the "size" attribute. For example, to set the font size to 14 pixels, we can use the following tag:
My text with font size 14px
To change the text color, we can use the tag again, but now specifying the color through the "color" attribute. For example, to set the text color to red, we can use the following tag:
My text in red color
To add boldness to the text, we can use the or tag. Both tags are equivalent and can be used in the same way. For example:
My text in bold
To add italics to the text, we can use the or tag. Both tags are equivalent and can be used in the same way. For example:
My text in italics
To add underlining to text, we can use the tag. For example:
My underlined text
In addition to these options, it is also possible to use other HTML tags to format the text, such as the tag to create superscript text, the tag to create subscript text, the tag to create strikethrough text, among others.
It is important to remember that, although text formatting is a useful tool to make web pages more attractive, it must be used sparingly and appropriately, so as not to compromise the readability and accessibility of pages. It is recommended to use CSS styles to format text more consistently and efficiently.
Now answer the exercise about the content:
You are right! Congratulations, now go to the next page
You missed! Try again.
Next page of the Free Ebook: