amit patel
amit patel

Reputation: 63

Font family in css not working

I am using YanoneKaffeesatz Font in my wordpress website. So to use this font first I generated code from FontSquirrel. Then I got this piece of code

@font-face {
font-family: 'yanone_kaffeesatz_lightRg';
src: url('yanonekaffeesatz-light-webfont.eot');
src: url('yanonekaffeesatz-light-webfont.eot?#iefix') format('embedded-opentype'),
     url('yanonekaffeesatz-light-webfont.woff') format('woff'),
     url('yanonekaffeesatz-light-webfont.ttf') format('truetype'),
     url('yanonekaffeesatz-light-webfont.svg#yanone_kaffeesatz_lightRg') format('svg');
font-weight: normal;
font-style: normal;
}

Then I paste the code in my css file and paste all the converted fonts(.otf,.svg, .ttf) in my website folder but still my font has not been changed. So can some one tell me why this is happening? Any help and suggestions will be highly appreciable.

Upvotes: 0

Views: 3558

Answers (1)

SpaceBeers
SpaceBeers

Reputation: 13957

Are the font files in the same dir as your stylesheet? You're currently pointing to that dir. Paths in CSS are relative to the stylesheet, not the root.

root 
  -css/styles.css
  -images/
  -fonts/
  index.html

With the above structure you would use this as your URL.

url('../fonts/your_font.font;);

Upvotes: 1

Related Questions