使用jade模板时css样式问题

在使用jade的时候遇到一个问题,在 style 中使用标签选择器

doctype html
html(lang='en')
  head
    title= hellojade
    style
      section {
        margin: 20px auto;
        border:1px #eaeaea solid;
        width:80%;
        height:200px; }
      section div {
        margin: 10px; }
  body
    h1 Hello Jade
    section#part1!= part1
    section#part2!= part2

模板引擎解析后css 样式失效,原因是把 section 解析成了html标签而不是标签选择器?、

clipboard.png

阅读 11.2k
2 个回答

easy, style -> style., done.

一看就是不好好看文档的。

style.
    div{
        float:left
    }
script.
    var a = 1;
    
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进