DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Abbr Formatting

03.13.2008
| 3480 views |
  • submit to reddit
        haml (easily transformed to css) snippet to format abbrs in a proper manner - you can still type them in ALL CAPS, but they will be displayed in Titlecase and small-caps. If you're using this, you're probably also using a custom face via @font-face, so you might want to explicitly declare the small-caps and lowercase variants of the typeface - the browser often fucks up auto-small-caps.

also, not tested in internet explorer. nothing I write is.

abbr
  :display inline-block
  :text-transform lowercase
  :font-variant small-caps
  
  &:first-letter
    :text-transform uppercase