CSS text

You are currently viewing CSS text

CSS text is used to apply the different formatting in the text. HTML provides limited facilities for text formatting. CSS provides complete control on text formatting, presentation, and style.

Text Color

Text color is changed by specifying any color to color property. The color value can be specified as hexadecimal code like #00DDFF or a named color value like red as follows:



The typeface is used to specify the font-family of the text as follows:

  font-family:Verdana, Arial, Helverica, sans-serif;

The browser will keep going down the list of specified faces until it finds one that is installed on the system. If no font in the list is installed on the system, a font similar to the specified face will be used.

CSS Text size

CSS text can be used to specify the text size. HTML can display the text of size 7 at maximum. In CSS Text, the font-size property is used to specify the size of the text. The size can be specified by using different units that are as follows:

  • Units: points and pixels
  • Pre-defined keywords
  • Percentages

Size in Points


Size in Pixels


To increase the font weight check this CSS Bold text article.

More Units

There are few other units of text-measurement that are Lexx widely used:

  • in is inches
  • cm is centimeters
  • mm is millimeters


There are seven keywords that work similarly to the values. The possible values are below:

  • xx-small
  • x-small
  • small
  • medium
  • large
  • x-large
  • xx-large


Percentage values are relative to the size of the parent value.

  font-size: 20pt;

In the above example, the font size of <body> is 20pt and font size of <p> is 200%. Any paragraph inside <body> will be sized 40pt.


If you want to learn more about CSS visit the official website: Visit

css text

Visit the CSS tutorial list. And make strong your CSS concept. Click here. wuschools.com is always written about the CSS concept for the CSS lover. Ang writes about how CSS makes your life easy if you are a web site developer. We help you to continue your learning.

Leave a Reply