该错误显示在以下行:
link(rel='stylesheet',href='https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css')
下面是标记:
html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css',type='text/css')
link(rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css",type='text/css')
body
.add-entry
h3#title Add an entry
form(id='add', method='post', action='/entry/add')
.form-group
label(for='comment')
h6 Description:
input#comment.form-control(rows='5' type='text' size='30' name='description')
.form-group
label(for='sev')
h6 Severity
select#sev.form-control(name='severity')
option Low
option Average
option Critical
br
br
button.btn.btn-primary(type='submit') Submit
有人可以帮忙吗?更新了标记。错误显示在第4行
答案 0 :(得分:2)
当您缩进link元素下方的行时,会发生此错误,如下所示:
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css',type='text/css')
link(rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css",type='text/css')
这试图在另一个链接元素(如错误所述)无效的内部创建一个链接元素。
以后,请确保所有链接元素在同一级别对齐:
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css',type='text/css')
link(rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css",type='text/css')