Jump to content

CSS3 My own font problem


lambik

Recommended Posts

Hi. I am working on my own web page and I read I can use my own fonts so I visited some webpages and downloaded font, let's call it font.ttf. Now, I want it in my web page but even if I have done everything as written in CSS3 Fonts it is not working. I copied example so I wonder there is problem with url. In folder1/pages/ is my homepage.html and in folder1 is my style.css and font.ttf. Can anybody help me what I should type as url in @font-face rule? Thanks

Link to comment
Share on other sites

when you have questions, you should post the code you are using or a link so we can see exactly what you are doing.based on the info from the w3schools tutorials http://www.w3schools.com/css3/css3_pr_font-face_rule.asp,and the info you provided, I would try this

@font-face{  font-family: myFont;  src: url('font.ttf');}

Link to comment
Share on other sites

Ok so I will try to describe it more.There is folder on my desktop Web/Layout1/pages/homepage.html which uses external css script located in Web/Layout1/style1.css and also font.ttf in Web/Layout1/font.ttf.Until this everything was working fine so I think there is no need to copy whole code.In style1.css is line @font-face {font-family: myFont; src:url('font.ttf');} and .nadpis {width:800px; height:26px; margin-left:auto; margin-right:auto; text-align:center; font-size:24px; font-family:myFont; font-weight:bold; padding:5px; background-image:url(images/logo.jpg);} and I want to use it as a heading so I put this piece of code to my homepage <div class="nadpis">gfgfg</div>. If I change font-family to Arial or something like that it's working. Thanks for help.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...