Text formatting is a crucial aspect of web design, adding flair and emphasis to your content. In this chapter, we'll explore various text formatting techniques in HTML, ensuring your words not only convey meaning but also captivate your audience.
To make text bold, use the <strong>
tag, and for italics, use the <em>
tag.
This is bold and this is italic.
The <u>
tag adds an underline, and the <s>
tag creates a strikethrough effect.
Underline this text, and strikethrough this.
Use <sup>
for superscript and <sub>
for subscript.
102 is 100 (superscript) and H2O is water (subscript).
Style text with color using the color
attribute and adjust size with the font-size
attribute.
This text is blue and 18 pixels in size.
Set the text alignment using the text-align
property.
This text is centered.
Transform text to uppercase or lowercase using text-transform
.
This text is in uppercase.
This text is in lowercase.
Explore : Advance text features
In mastering text formatting, you've unlocked the ability to enhance your web design. Experiment with these techniques to find your style. Remember, effective text formatting not only communicates information but also adds a visual rhythm to your webpage. Keep practicing, and soon you'll be weaving text into a design masterpiece. Happy coding !❤️