simple font face apparently

busso
busso
https://jsfiddle.net/busso/6wypnx0a/

can anyone figure out why this isnt working

Comments

  • Sherbs
    Sherbs
    Oo-ee-oo Posts: 2,961 edited July 2016
    url('../css/news_cycle.ttf')
    

    Where is the ttf file?

    Think that's your problem.
  • calder12
    calder12
    Senior Member Posts: 13,484
    1. Relative links don't work on jsFiddle, therefore it's never loading those fonts.
    2. You declare the font family before importing the fonts in your CSS. CSS reads sequentially, the fonts have to be there before they're used.
  • busso
    busso
    edited July 2016
    calder12 wrote: »
    1. Relative links don't work on jsFiddle, therefore it's never loading those fonts.
    2. You declare the font family before importing the fonts in your CSS. CSS reads sequentially, the fonts have to be there before they're used.

    im not sure what you mean because i checked my code and the font-face rule was after where i declared the font for styling. anyhow i changed it around and put the font-face rule first but it still didnt work

    the directories are good on my pc though so thats not the problem
  • calder12
    calder12
    Senior Member Posts: 13,484 edited July 2016
    Exactly. You had them in the wrong order.

    You're setting the font-family in the second line of that fiddle.
    Then further down you're importing the fonts.

    When you set that font face in line 2 the site has no idea what the news_cycle font is, by the time you tell it, it's too late.

    As to it not working after, I can almost promise you it's one of two things.
    1. Your relative links are wrong (my guess)
    2. The actual ttf files are bad.

    Try setting an absolute URL just for now or changing the relative URL to /css/whatever

    PS. Why are you storing fonts in your css folder? ._.

    PPS. It is never going to work in the fiddle, you realize that right?
  • handcraftedweb
    handcraftedweb
    thought leader Left coastPosts: 6,796
    busso wrote: »
    the directories are good on my pc though so thats not the problem

    You can't use fonts that are on your local computer in jsFiddle. Simply not possible. But you can use google fonts in jsFiddle. If you're just exploring/playing around, using google fonts would simplify things.
  • busso
    busso
    i realise its not going to work in js fiddle. thanks though i got it sorted. still very new to this stuff
  • calder12
    calder12
    Senior Member Posts: 13,484
    So, after all that, care to tell us what the issue was?
Sign In or Register to comment.
© Copyright 2003 - 2016 - DT by Kooc Media