我正在开发一个导航栏,我试图在导航栏上设置一个按钮,格式如下:
(图标)(文本)
以下是 Jade 文件的摘录:
a(href="/signup")
h3 Sign Up
span(style="font-size: 1.25em; margin-top:2%" href="/graphing").glyphicon.glyphicon-pencil
目前这会产生:
(文字)(图标)
我怎样才能让跨度位于 h3 内部,但位于 jade 中的文本之前?
最佳答案
您应该使用管道文本:
a(href="/signup")
h3
span(style="font-size: 1.25em; margin-top:2%" href="/graphing").glyphicon.glyphicon-pencil
| Sign Up
<小时/>
Piped Text
The simplest way of adding plain text to templates is to prefix the line with a | character (pronounced "pipe").
关于node.js - 在 Jade 中使 span 位于文本之前,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22084268/