Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 翡翠解析器:“;不允许匿名块,除非它们是mixin的一部分;错误_Node.js_Express_Block_Pug_Anonymous - Fatal编程技术网

Node.js 翡翠解析器:“;不允许匿名块,除非它们是mixin的一部分;错误

Node.js 翡翠解析器:“;不允许匿名块,除非它们是mixin的一部分;错误,node.js,express,block,pug,anonymous,Node.js,Express,Block,Pug,Anonymous,我有一个错误: “不允许匿名块,除非它们是mixin的一部分” 使用此翡翠文件: html body style(type='text/css', media='screen') div#div_name display: block height: 300px 显然,问题出在显示:块-有什么想法\解决方案吗?以下内容 style(type='text/css', media='screen') div#d

我有一个错误:

“不允许匿名块,除非它们是mixin的一部分”

使用此翡翠文件:

html
    body
        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 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>
将编译为:

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

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

部门名称{
显示:块
高度:300px
}

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

注意
display
height
不是html标记。因此,您可以编写
#div_name(style=“display:block;height:300px”)