Learning the HTML Codes for Text

Learning the HTML Codes for Text
Page content

It’s easy to learn simple HTML coding to modify text on your website or blog. There are HTML codes for text that can change the color, size, and style of your font. Try out several new codes or combine them to create a particular look and feel for your text.

HTML Codes for Font Size

One of the first aspects of your text you’ll likely want to modify is the size of your font. This is one of the easiest codes to incorporate into your HTML coding because you simply assign the text a numerical number, which the browser then reads and displays as the appropriated size.

This is size 1 font

In the above example, you can replace the “1” with any number from 2 to 7. The larger the number, the larger the font will appear. Naturally, you’ll want to replace the phrase “This is size 1 font” with your desired text. HTML text sizes are not the equivalent of standard font sizes, but there is a correlation. For example, an HTML font size 1 creates an 8 point standard font size, and an HTML font size of 7 creates a 36 point standard font size.

HTML Codes for Font Faces

You can quickly change the font face of your text to any font that you have installed on your computer.

This is Calibri text

Simply replace “Calibri” with your chosen font face and replace “This is Calibri text” with your text. It’s important to note that if a user doesn’t have the font face installed on their computer that you used in your HTML code, the browser will likely default to Times New Roman.

HTML Codes for Font Styles

To change the physical style of your font, simply place desired text tags around your text. Note that your text should replace the words between the tags to properly define your text. Try incorporating these of these basic tags into your HTML codes for text:

Bold Text

Italic Text

Subscripted Text

Superscripted text

Striked-Out Text

Underlined Text

HTML Codes for Font Colors

Changing the color of your font is a fun, experimental process. Font colors are creating using a mix of the three primary colors, which forms a hexadecimal code. This provides you with numerous color options. One of the easiest ways to define your text color is to use a free online tool such as W3Schools.com’s color picker to select a color of your choosing.

To define the color of you font in you HTML codes for text, simply replace the “##330033", which yields below with a color code of your choosing.

Deep purple text

HTML Text Codes: Putting It All Together

Learning basic HTML codes for text increases your creative options and provides you with the means to create personalized text for your website, blog, or email.

For example, using various codes learned above, you can create the following code:

to yield the following result:

HTML Example