本文介绍了字体不能在其他计算机上工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚主持了我的第一个网站



点击您选择的字体上的使用....会出现一行html,如下所示:

 < link href ='https://fonts.googleapis.com/css?family = Open + Sans'rel ='stylesheet'type ='text / css '> 

把它放在网站的head部分(注意: < head> 标记与您网站上的< header> 标记不一样。



我建议您参阅



编辑完成答案



安全字体



我忘记了安全字体,直到我在其他答案中看到我想完成这个答案/ p>

如果你不想使用谷歌的字体,你可以使用安全字体(阅读关于它们


I just hosted my first website http://ianwinson.net and have the fonts customised in the html, but they are not showing up on other people's computers, just showing up as default text. This is what it looks like on my end:

By the way, the way I am defining fonts is using font face and the <font> tag in html before the text. For the buttons I use font: face, but that's not working either:/. The fonts are Garamond, and Open Sans.

解决方案

I have taken a look at your code. You're problem is that you are not importing any fonts... However you are asking it to use a font that isn't there.

font-family: 'Open Sans';

Also you seem to have only applied it to button.

So what you need to know: If the font is not a "safe font" (see below for more info" then you need to import it:

Go to google.com/fonts

Click "Use" on the font of your choice.... there will be a line of html that will look something like the following:

<link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>

Put that in the head section of your website (note: <head> tags are not the same as the <header> tags that you have on your website).

I would suggest that you see this w3 page that shows you a basic structure and where you should put your <head> tags in relation to the rest of you website.

Anyway once you have the line of html in the head tags, simply apply the css font-family code to the item you want to have the font (the line of css will look something like this: font-family: 'Open Sans', sans-serif; ) please note that Google provides you the code to use.

If you want bold, italics, or things like that you need to select it at the top of the page (just above where it gives you the code to add to your site):

Edit to make answer complete:

Safe Fonts

I forgot about safe fonts until I saw it in the other answer and I wanted to make this answer complete.

If you don't want to use fonts from Google you can use "safe fonts" (read about them here ((w3 page))).

Essentially they are fonts that you can use without importing the font from an external (or local) source. They are hardwired (preloaded if you will)Now everyone should be able to see the font!

Good luck!

Oh and one more thing... At the bottom of your code you seem to be calling a javascript file that leads to nothing (the file is not there that you are calling). Not a huge deal, but it is probably better removed than not:

这篇关于字体不能在其他计算机上工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 10:35