Jade Parser:“除非匿名块是mixin的一部分,否则不允许使用".错误 [英] Jade Parser: "Anonymous blocks are not allowed unless they are part of a mixin" Error

查看:72
本文介绍了Jade Parser:“除非匿名块是mixin的一部分,否则不允许使用".错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了这个错误:

除非匿名块是mixin的一部分,否则不允许使用该块"

使用此Jade文件:

html
    body
        style(type='text/css', media='screen')
        div#div_name
            display: block
            height: 300px

显然问题出在 display:block -有任何想法\解决方案吗?

obviously the problem is with display: block - any ideas \ solutions?

推荐答案

以下翡翠

style(type='text/css', media='screen')
div#div_name
    display: block
    height: 300px

无法编译.

<style type="text/css" media="screen"></style>
<div id="div_name">
    <display><block></block></display>
    <height>...... and then you get an error with the 300px
</div>

要包含 literal 文本,请在元素的末尾添加一个句点.

To include literal text, put a period at the end of the element.

style(type='text/css', media='screen')
div#div_name.
    display: block
    height: 300px

将编译为:

<style type="text/css" media="screen"></style>
<div id="div_name">
    display: block
    height: 300px
</div>

现在,我想这可能不是您想要的. 我猜想您的样式标签中确实需要div#div_name,因此您应该编写以下内容.注意文本是如何缩进的,在style元素的末尾有一个句点.

Now, I’m guessing that’s probably not what you want. I’m guessing you want the div#div_name literally in your style tag, so you should write the following. Notice how the text is indented, and there’s a period at the end of the style element.

style(type='text/css', media='screen').
    div#div_name {
        display: block
        height: 300px
    }

将编译为:

<style type="text/css" media="screen">
    div#div_name {
        display: block
        height: 300px
    }
</style>

最后,不要忘记在CSS中使用分号.

Lastly, don't forget to use semicolons in CSS.

这篇关于Jade Parser:“除非匿名块是mixin的一部分,否则不允许使用".错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆