背景不会改变颜色

时间:2018-04-25 12:09:29

标签: html css

[编辑]问题解决了......似乎这是一个错误或什么的。我刚刚重新安装了库并重新改变了颜色,一切顺利:/

第一次CSSS

 html, body {
          margin: 0;
          padding: 0;
          width: 100%;
    }

    body {
          font-family: "Helvetica Neue",sans-serif;
          font-weight: lighter;
    }

    header {
          width: 100%;
          height: 100vh;
          background: url(hero.jpg) no-repeat 50% 50%;
          background-size: cover;
    }

    .content {
          width: 94%;
          margin: 4em auto;
          font-size: 20px;
          line-height: 30px;
          text-align: justify;
    }

    .logo {
          line-height: 60px;
          position: fixed;
          float: left;
          margin: 16px 46px;
          color: #fff;
          font-weight: bold;
          font-size: 20px;
          letter-spacing: 2px;
          text-transform: uppercase;
    }

    nav {
          position: fixed;
          width: 100%;
          line-height: 60px;
    }

    nav ul {
          line-height: 60px;
          list-style: none;
          background: rgba(0, 0, 0, 0);
          overflow: hidden;
          color: #ffffff;
          padding: 0;
          text-align: right;
          margin: 0;
          padding-right: 40px;
          transition: 1s;
    }

    nav.black ul {
          background: #ffffff;
    }

    nav ul li {
          display: inline-block;
          padding: 16px 40px;;
    }

    nav ul li a {
          text-decoration: none;
          color: #ffffff;
          font-size: 16px;
    }

    .menu-icon {
          line-height: 60px;
          width: 100%;
          background: #ffffff;
          text-align: right;
          box-sizing: border-box;
          padding: 15px 24px;
          cursor: pointer;
          color: #ffffff;
          display: none;
    }

    @media(max-width: 786px) {

          .logo {
                position: fixed;
                top: 0;
                margin-top: 16px;
          }

          nav ul {
                max-height: 0px;
                background: #ffffff;
          }

          nav.black ul {
                background: #ffffff;
          }

          .showing {
                max-height: 34em;
          }

          nav ul li {
                box-sizing: border-box;
                width: 100%;
                padding: 24px;
                text-align: center;
          }

    .menu-icon {
      display: block;
    }

悬停CSS

.hvr-overline-reveal {
  display: inline-block;
  vertical-align: middle;
  -webkit-transform: perspective(1px) translateZ(0);
  transform: perspective(1px) translateZ(0);
  box-shadow: 0 0 1px rgba(0, 0, 0, 0);
  position: relative;
  overflow: hidden;
}
.hvr-overline-reveal:before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 0;
  right: 0;
  top: 0;
  background: #ffffff;
  height: 4px;
  -webkit-transform: translateY(-4px);
  transform: translateY(-4px);
  -webkit-transition-property: transform;
  transition-property: transform;
  -webkit-transition-duration: 0.3s;
  transition-duration: 0.3s;
  -webkit-transition-timing-function: ease-out;
  transition-timing-function: ease-out;
}
.hvr-overline-reveal:hover:before, .hvr-overline-reveal:focus:before, .hvr-overline-reveal:active:before {
  -webkit-transform: translateY(0);
  transform: translateY(0);
}

正如您所看到的那样,类型仍然是固定的,但它仍然无法正常工作。此外,检查是在阻止它的元素之前向我显示一个pseydo,它的背景颜色为蓝色。当我从检查员改变它时,eveerything是好的。当我从css更改它时它什么也没做。

2 个答案:

答案 0 :(得分:2)

你有一个额外的冒号,background-color : : #ffffff应该是background-color : #ffffff

答案 1 :(得分:1)

删除第二个冒号:

background-color : #ffffff;代替background-color : : #ffffff;