简体   繁体   中英

Cant get Jade syntax correct

I have this jade layout files but everytime I try to render it I get "unexpected text ;" on backgound: url(...). I am not sure how to fix. I have looked at other example and they do it like this.

doctype html
 html
head
style
  body {
    background: url('!{imageURI}');
    background-size:75%;
    background-repeat: no-repeat;
  }
body
h1 Tweets
h1 #{tweet.text}
h1  @#{tweet.user.screen_name}

You have two errors in your pug template:

  1. Leading space before html
  2. Missing dot after style .

The correct template can looks so:

doctype html
html
head
body
style.
  body {
    background: url('!{imageURI}');
    background-size: 75%;
    background-repeat: no-repeat;
  }
h1 Tweets
h1 #{tweet.text}
h1 @#{tweet.user.screen_name}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM