• 0

[CSS] font-variant: small-caps


Question

When I apply the small-caps attribute to the word "Experience", I want it to look like this:

EXPERIENCE

So basically, the upper-case letters should be bigger than the lower-case letters, even though they will both show up as capitalized. But as it turns out, all letters become capitalized and have the same size. Is there any way to have the word appear the way I want?

Link to comment
https://www.neowin.net/forum/topic/381166-css-font-variant-small-caps/
Share on other sites

2 answers to this question

Recommended Posts

  • 0

If it's only one word, the you could get away with using the psuedo-class ::first-letter, but that isn't going to work in IE. To do all words, you'd have to wrap the first letter of each word in a span and set font-variant: normal; in the CSS to affect those spans:

<style type="text/css">
.smallCaps { font-variant: small-caps; }
.smallCaps span { font-variant: normal; }
</style>
.
.
.
<div class="smallCaps"><span>E</span>xperience</div>

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

  • Recent Achievements

    • Dedicated
      Stephen Leibowitz earned a badge
      Dedicated
    • Dedicated
      Snake Doc earned a badge
      Dedicated
    • One Month Later
      Philsl earned a badge
      One Month Later
    • One Year In
      armandointerior640 earned a badge
      One Year In
    • One Month Later
      armandointerior640 earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      613
    2. 2
      ATLien_0
      235
    3. 3
      Xenon
      157
    4. 4
      +FloatingFatMan
      124
    5. 5
      Michael Scrip
      113
  • Tell a friend

    Love Neowin? Tell a friend!