0

I want to change my font it will be Foundry Sterling bold.

How to do that? Please help.

<!DOCTYPE html>
<html lang="en-us">
    <head>
        <style> 
            @font-face { 
                font-family: Foundry Sterling Bold;; 
                src: url('FoundrySterling-Bold.ttf'); 
            }
            p { 
                font-family:"Foundry Sterling Bold"; 
            } 
        </style>
    </head>
    <body>
        <p id="fsb">Bangalore</p>
        <p>Bangalore</p>
    </body>
</html>
Tasos K.
  • 7,979
  • 7
  • 39
  • 63
Sanjeev kumar
  • 65
  • 2
  • 7
  • Possible duplicate of [How to Apply global font to whole HTML document](http://stackoverflow.com/questions/7025756/how-to-apply-global-font-to-whole-html-document) – randers Mar 31 '16 at 19:58

2 Answers2

0
selector {
    font-family: "Foundry Sterling Bold";
}
Bluefire
  • 13,519
  • 24
  • 74
  • 118
  • What is your selector? Is it an element? The whole page? – Bluefire Mar 31 '16 at 12:51
  • Bangalore

    Bangalore

    – Sanjeev kumar Mar 31 '16 at 12:53
  • @Sanjeevkumar The code is correct. The reason it doesn't display is probably because the client browser does not have this font installed. Consider choosing a "web safe" font, this seems like quite an obscure font to me, and it makes sense that your browser doesn't have it. – Bluefire Mar 31 '16 at 12:57
0

Have you downloaded the font?

If so, try this:

@font-face {
    font-family: myfontname;
    src: url(public_html/mywebsite/fonts/myfont.woff);
}

p {
 font-family: "myfontname";
}
RasmusGlenvig
  • 765
  • 6
  • 18
  • /* here is my code it's not working please explain with example */

    Bangalore

    Bangalore

    – Sanjeev kumar Mar 31 '16 at 13:08
  • You have to be more specific with the url('') where is it stored? For instance when i'm using a custom font, I'm uploading it through a FTP client to a directory where all my fonts are. I gave you an example above, so you should try this. Otherwise you have two semicolons after Foundry Sterling Bold;; - you only need one ;) – RasmusGlenvig Mar 31 '16 at 13:17