Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

font-variant:small-caps; vs text-transform:capitalize;

Tags:

css

in css what is the difference between font-variant:small-caps; and text-transform:capitalize;

like image 625
Jitendra Vyas Avatar asked Mar 13 '10 11:03

Jitendra Vyas


People also ask

What this mean text-transform capitalize?

The text-transform CSS property specifies how to capitalize an element's text. It can be used to make text appear in all-uppercase or all-lowercase, or with each word capitalized. It also can help improve legibility for ruby.

Does the text-transform property controls the capitalization of text?

The text-transform property controls capitalization effects of an element's text.

What does font-variant small-caps do?

In a small-caps font, all lowercase letters are converted to uppercase letters. However, the converted uppercase letters appears in a smaller font size than the original uppercase letters in the text. The font-variant property specifies whether or not a text should be displayed in a small-caps font.

Can I use font-variant small-caps?

In CSS3, font-variant becomes a shorthand and can accept multiple values, including all-small-caps , petite-caps , all-petite-caps , titling-caps , and unicase , among others.


1 Answers

if you use text-transform: capitalize the word "stack overflow" will become "Stack Overflow", only the 1st letter of each word gets CAPS.

but if you use font-variant: small-caps the word "stack overflow" becomes "STACK OVERFLOW" but the height of the type-face will match the height of the lowercase letters before the CSS style was applied. so all CAPS but smaller. (Sᴛᴀᴄᴋ Oᴠᴇʀғʟᴏᴡ)

and text-transform: uppercase makes it all CAPS too but but the typeface stays the same size, so uppercase typeface will be bigger that small-caps

like image 168
pixeltocode Avatar answered Sep 22 '22 16:09

pixeltocode