Using the Font-Size Attribute

If seven type sizes seems ridiculous to you, you're not alone. CSS saves the day with virtually unlimited type sizes. Simply add the font-size attribute to your style definition, and supply the value and the units you want to use:

p {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
}

FAQ

Can I get more than seven HTML type sizes?

Clever Web designers have tried to squeeze additional type sizes out of HTML by setting a font tag to size 7 for starters and then increasing the size with a relative font tag immediately afterward. If this is you, then give yourself a pat on the back for your craftiness, but unfortunately ...

Get Web Design Garage now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.