What is the @ for in css?

by 5 replies
6
Checking out css files for interesting sites, I often see something like:

Code:
@font-face {
  font-family: 'PT Serif';
  font-style: italic;
  font-weight: bold;
   }
I've googled it, and couldn't even find an @ in the pages that resulted. What is it used for?
#website design #css
  • Hi Lloyd

    You might find this link to be informative:

    The Essential Guide to @font-face

    Essentially this was originally a Firefox addition that allowed you to specify fonts that were not necessarily on the users machine. Using this format you can reference fonts installed on other web servers.

    Bill
    • [ 1 ] Thanks
    • [1] reply
    • That link had a lot of info, thanks. That should finally teach me to give a google search a second try.

      There is quite a lot involved. The (wimp?) in me wants to just stick with 'verdana,arial,sans-serif' but that could solve one annoying little problem. I like Calabri but it is smaller than the more common fonts. If a larger one is substituted it can mess up the layout.
      • [1] reply
  • hi Lloyd
    @font-face
    {
    font-family:'kdk';
    src:url(kdk.eot);
    src:local('kdk'),
    url(kdk.ttf)
    format('opentype')
    }

    this script add font to page for all browser such as ie6
  • use in css by this source
    font-family:'kdk';

Next Topics on Trending Feed

  • 6

    Checking out css files for interesting sites, I often see something like: Code: @font-face { font-family: 'PT Serif'; font-style: italic; font-weight: bold; } I've googled it, and couldn't even find an @ in the pages that resulted. What is it used for?