Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/477.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.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
Javascript express.js中使用CSS的问题_Javascript_Css_Express_Pug - Fatal编程技术网

Javascript express.js中使用CSS的问题

Javascript express.js中使用CSS的问题,javascript,css,express,pug,Javascript,Css,Express,Pug,我正在与网络开发的世界接触。我正在学习如何使用express.js创建后端。但是最近我遇到了一个CSS问题:特别是一些CSS选择器没有被考虑,例如在下面的代码中,h1选择器可以工作,而#页面容器选择器不能。 感谢任何能帮助我的人 layout.pug doctype html html head title= title link(rel='stylesheet', href='/stylesheets/index.css') link(rel="preco

我正在与网络开发的世界接触。我正在学习如何使用express.js创建后端。但是最近我遇到了一个CSS问题:特别是一些CSS选择器没有被考虑,例如在下面的代码中,h1选择器可以工作,而#页面容器选择器不能。 感谢任何能帮助我的人

layout.pug

doctype html
html
  head
    title= title
    link(rel='stylesheet', href='/stylesheets/index.css')
    link(rel="preconnect" href="https://fonts.gstatic.com")
    link(href="https://fonts.googleapis.com/css2?family=Arvo:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet")
  body
    block content
extends layout
    
block content
  #page-container
    #title-container
      h1 LOGIN
    #center-container
      #thumb-container
        img(src='#')
        #button-container
          button(src='#')
index.pug

doctype html
html
  head
    title= title
    link(rel='stylesheet', href='/stylesheets/index.css')
    link(rel="preconnect" href="https://fonts.gstatic.com")
    link(href="https://fonts.googleapis.com/css2?family=Arvo:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet")
  body
    block content
extends layout
    
block content
  #page-container
    #title-container
      h1 LOGIN
    #center-container
      #thumb-container
        img(src='#')
        #button-container
          button(src='#')
index.css


h1{
字体系列:佐治亚州阿尔沃,“泰晤士报新罗马”,泰晤士报,衬线;
字号:700;
线高:1.1;
颜色:继承;
};
#页面容器{
最大宽度:992px;
颜色:浅灰色;
利润率:10px自动;
身高:100%;
};
应要求,我正在通过添加浏览器呈现的HTML来编辑问题

呈现的HTML


快车
登录

这是一个输入错误,但我正在回答,所以OP可以看到它

在CSS中的规则之后。删除以下内容:

h1{
字体系列:佐治亚州阿尔沃,“泰晤士报新罗马”,泰晤士报,衬线;
字号:700;
线高:1.1;
颜色:继承;
}
#页面容器{
最大宽度:992px;
颜色:浅灰色;
利润率:10px自动;
身高:100%;
}

登录

这是一个输入错误,但我正在回答,所以OP可以看到它

在CSS中的规则之后。删除以下内容:

h1{
字体系列:佐治亚州阿尔沃,“泰晤士报新罗马”,泰晤士报,衬线;
字号:700;
线高:1.1;
颜色:继承;
}
#页面容器{
最大宽度:992px;
颜色:浅灰色;
利润率:10px自动;
身高:100%;
}

登录