在Jade的文本之前制作跨度

时间:2014-02-28 01:16:33

标签: node.js twitter-bootstrap express pug

我正在使用导航栏,我正试图在栏上设置按钮格式:

(图标)(文本)

以下是玉文件的摘录:

a(href="/signup")
  h3 Sign Up  
    span(style="font-size: 1.25em; margin-top:2%" href="/graphing").glyphicon.glyphicon-pencil

目前这会产生:

(文字)(图标)

我怎么能拥有它,所以跨度在h3内,但是在玉器中的文本之前?

1 个答案:

答案 0 :(得分:4)

您应该使用管道文字:

a(href="/signup")
  h3
    span(style="font-size: 1.25em; margin-top:2%" href="/graphing").glyphicon.glyphicon-pencil
    | Sign Up

来自The documentation

  

管道文字

     

向模板添加纯文本的最简单方法是在行前面加上|字符(发音为“pipe”)。