且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

字体不能在其他计算机上工作

更新时间:2022-12-22 23:00:56

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: