Header 中未显示背景图片

Background Image Not Showing In Header

CSS 背景图片未显示。这是标题部分的手写笔文件:

.header {
  height 50vh
  border-bottom 5px solid #34495E
  background url(img/head.png) no-repeat center center fixed
  background-size cover
}
.nav {
  display flex
  align-items center
  justify-content flex-end
  padding 1em
  background rgba(0,0,0,0.5)
  position fixed
  top 0
  left 0
  width 100%
  z-index 5
}
.nav-item {
  list-style none
  display inline
  padding 1em
}
a {
  text-decoration none
  color #ececec
  transition 1s
  padding-right 1em
}
a:hover {
  color darken(#ececec, 25%)
  text-decoration underline
}
.space {
  content " "
  height 3.0625em
}

这是它的样子:

这应该是 header 的背景图像(其中有 Darcey Mckelvey 的白色部分):

您尝试过在 .header 中添加宽度吗?说:

.header{
    width:100%
}

删除页眉的高度 class。

   .header {
   border-bottom: 5px solid #34495E;
   background: url('img/head.png') no-repeat center center fixed;
   background-size: cover;
   }