【问题标题】:Make span come before text in Jade在 Jade 中使 span 出现在文本之前
【发布时间】:2014-03-31 19:29:35
【问题描述】:

我正在使用导航栏,我正在尝试让栏上的按钮采用以下格式:

(图标)(文本)

这是玉文件的摘录:

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

目前这会产生:

(文本)(图标)

我怎样才能让跨度在 h3 内,但在玉文本之前?

【问题讨论】:

    标签: node.js twitter-bootstrap express pug


    【解决方案1】:

    您应该使用管道文本:

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

    来自The documentation

    管道文本

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

    【讨论】:

    • 对我来说不直观,但仍然有效!
    猜你喜欢
    • 1970-01-01
    • 2023-03-16
    • 1970-01-01
    • 1970-01-01
    • 2014-09-12
    • 2015-01-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多