HTML Font Code
The above font code sets common properties such as font size, line height, font family, and font color. Here are some more colors to choose from.
The Font Properties
When coding HTML, CSS is what you use for formatting. Here are the CSS font/text properties:
font
font-family
font-size
font-size-adjust
font-stretch
font-style
font-variant
font-weight
letter-spacing
line-height
color
background-color
text-align
text-decoration
text-indent
text-shadow
text-transform
You can see some of these properties in action below.
Font Family
If you only want to specify the font family, you can use the font-family
property:
Font Size
If you only want to specify the font size, you can use the font-size
property. You can also use the line-height
property to adjust the height of each line:
Color
If you only want to specify the font color, you can use the color
property (more colors):
Bold
You can make your font bold by using the font-weight
property:
If you only want to bold some of the text inline, you can use the HTML <span>
tag:
Italic Text
You can make your text italic by using the font-style
property:
If you only want to make some of the text italic, you can use the HTML <span>
tag: