Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use custom fonts on a website? [duplicate]

Tags:

html

fonts

In order for my website to look good I need to use a custom font, specifically, Thonburi-Bold. The problem is - the font does not get displayed unless the user has installed it. It also isn't displayed in firefox.

Is there a workaround to this problem?

like image 820
James Logan Avatar asked Nov 27 '12 13:11

James Logan


People also ask

How do I copy a font style from a website?

You can highlight the text on the web page that you want to determine the font. Copy that text (right-click with your mouse and select Copy, or press Ctrl + C on your keyboard).

How do I put different fonts in HTML?

To change font size in HTML, use the CSS font-size property. Set it to the value you want and place it inside a style attribute. Then add this style attribute to an HTML element, like a paragraph, heading, button, or span tag.


2 Answers

You have to import the font in your stylesheet like this:

@font-face{     font-family: "Thonburi-Bold";     src: url('Thonburi-Bold.ttf'),     url('Thonburi-Bold.eot'); /* IE */ } 
like image 77
Zencode.dk Avatar answered Oct 02 '22 19:10

Zencode.dk


You can use CSS3 font-face or webfonts

@font-face usage

@font-face {    font-family: Delicious;     src: url('Delicious-Roman.otf'); }  

webfonts

take a look at Google Webfonts, http://www.google.com/webfonts

like image 20
Muthu Kumaran Avatar answered Oct 02 '22 20:10

Muthu Kumaran