我正在学习如何使用Bootstrap。由于我有几个网站,我希望将Bootstrap样式表 - bootstrap.css和bootstrap.min.css - 放在一个网站(“mysite.com”)上,并将其他网站链接到它们。
问题是这样做时,我的图标无法显示。我发现了一个名为“fonts”的文件夹,并将其复制到了mysite.com。然后我找到了需要更改的bootstrap.min.css中的样式:
@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings- regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings- regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings- regular.svg#glyphicons_halflingsregular) format('svg')}
实际上,看起来这两个是我需要改变的唯一选项:
url(../fonts/glyphicons-halflings-regular.woff) format('woff'),
url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),
但我一直没有能够重写链接以使它们正常工作。例如,url(http://mysite/css/bootstrap/fonts/glphicons(etc.))无法工作。
是否可能跨站点链接glyphicon字体?如果不行,另一个可能性是我可以将样式表放在mysite.com上,但将字体复制到每个站点,然后将这些样式放在每个页面的头部,以便可以指向正确的目录。