字体很棒的图标没有显示在玉模板中

时间:2015-08-02 12:24:06

标签: node.js express twitter-bootstrap-3 pug font-awesome

我在我的node.js / express app中使用jade进行模板化。但是当我尝试使用字体很棒时,图标不会显示,只列出项目符号。我已经尝试过搜索引擎找到的所有方法。例如fa.fa-globe问题。 这里的代码取自footer.jade

 span This is some other footer stuff.
    ul
      li.fa.fa-google-plus
        a(href='#')
        i.fa.fa-facebook
      li
        a(href='#')
        i.fa.fa-lg.fa-twitter
      li
        a(href='#')
        i.fa.fa-lg.fa-google-plus
      li
        a(href='#') 
        span.fa.fa-lg.fa-linkedin
 span and some more footer stuff.

正如您在上面所看到的,我已经尝试了各种方法,i,span和classes

我的layout.jade如下:

doctype html
html
  head
    title= title
    meta(name='viewport', content='width=device-width, initial-scale=1.0')
    link(href='https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.5/darkly/bootstrap.css', rel='stylesheet', media='screen')
    link(href='http://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css')
    link(rel='stylesheet', href='/stylesheets/style.css')
  include ./header.jade
  body(style="padding-bottom:10rem;")
    block content

  script(src='http://code.jquery.com/jquery.js')
  script(src='http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js')

感谢

2 个答案:

答案 0 :(得分:2)

主要问题是您错过了字体真棒rel='stylesheet'的{​​{1}}属性。这将使字体真棒图标正常工作。

但是,如果您尝试使用图标替换列表中的项目符号,则需要在字体上将{@ 3}}上的页脚列表项调整为令人敬畏的示例页面。例如:

<link>

答案 1 :(得分:0)

如果您看到图标应为空符号,则可能需要在布局头添加编码:

meta(charset="utf-8")
相关问题