视差背景不重复

时间:2019-01-07 22:45:17

标签: html css

我正在尝试为我的一项任务编写网站代码,并且我想要平铺的视差背景,而且我检查了我的代码,但不知道为什么它不起作用。图片正确无误,但仅在中间显示,没有平铺。它也奇怪地出现在导航栏后面。

#navbar {
  overflow: hidden;
  background-color: #f1f1f1;
  padding: 90px 10px;
  transition: 0.4s;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 99; 
}

#navbar a {
  float: left;
  color: black;
  text-align: center;
  padding: 12px;
  text-decoration: none;
  font-size: 18px; 
  line-height: 25px;
  border-radius: 4px;
}

#navbar #logo {
  font-size: 35px;
  font-weight: bold;
  transition: 0.4s;
}

#navbar a:hover {
  background-color: lightgoldenrodyellow;
  color: gold;
}

#navbar a.active {
  background-color: lightgoldenrodyellow;
  color: black;
}

#navbar-right {
  float: right;
}

@media screen and (max-width: 580px) {
  #navbar {
    padding: 20px 10px !important;
  }
  #navbar a {
    float: none;
    display: block;
    text-align: left;
  }
  #navbar-right {
    float: none;
  }
{ 
  background-image: url("HA%20paintbrush%20aids.png");

  background-attachment: fixed;
  background-position: center;
  background-repeat: repeat;
  background-size: 500px 500px;
}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="stylesheet.css">
</head>
<body>

<div id="navbar">
  <a href id="logo">tamia.</a>
  <div id="navbar-right">
      <a href="#artist_statement">Artist Statement</a>
    <a class="active" href="#polished_pieces">Pieces</a>
    </div>
</div>

<div class="parallax"></div>

</body>
</html>

我的代码有什么问题?我真的很害怕必须从头开始。我正在使用方括号来编码和预览我的代码。

0 个答案:

没有答案