问题
How do you force close a tag in jade? This may be a be a bad example, but If i wanted to put a div in between the </head>
& <body>
回答1:
Just write HTML in your jade
doctype html
html(lang="en")
<head></head>
body jade again
But you cannot put jade into your head
elements, so when you start using HTML you cannot mix its content and children with jade.
回答2:
If you wanted to put something like <div class="your-content"></div>
between the body
and head
, you don't need to resort to plain html. Instead:
doctype html
html(lang="en")
head
...more pug/jade...
.your-content
...more pug/jade...
body
...more pug/jade...
来源:https://stackoverflow.com/questions/25650988/how-do-i-force-close-a-tag-in-jade-templates