Controlling Capitalization

The text-transform property lets you specify how you want an element's text to be capitalized. The values accepted by the text-transform property include none, capitalize, uppercase, and lowercase. The default value is none, which leaves any capitalization unchanged. The capitalize value capitalizes the initial letters in the text; the uppercase value capitalizes sets all letters to uppercase; and the lowercase value sets all letters to lowercase. Here's an example of setting all the letters in the H2 elements to uppercase (see Figure 8.14):

h1 {  text-decoration: underline; text-align: center; font-size: 2.5em; color:
rgb(200,140,40); }
h2 {  text-transform: uppercase; }
					
Figure 8.14. The H2 elements are set in all ...

Get Cascading Style Sheets (CSS) by Example 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.