jquery - Transparent nav-bar -


i have following issue:

  • i use navbar background-color
  • i want delete background-color , make transparent
  • i deleted background , applied position:absolute it

information: image blow shows design after position:absolute. attached sample code showing original design before applied changes make transparent.

problem: after applied position:absolute navbar items moved right left.

goal: make goal clear: want same navbar transparent background.

images shows change after position:abosulte

* {    box-sizing: border-box;    margin: 0;    padding: 0;  }    .row {    clear: both;  }    .spalten-6 {    width: 49.99992%;  }    .spalten-12 {    width: 100%;  }    .spalten-6,  .spalten-12 {    float: left;  }    .img-box img {    width: 100%;  }    .img-box {    border-left: 2px solid white;    border-top: 2px solid white;  }    #video-container {    position: relative;    height: 300px  }    #video-container {    top: 0%;    left: 0%;    height: 100%;    width: 100%;    overflow: hidden;  }    video#bgvid {    position: absolute;    z-index: -1;    background: url('http://ewallpaperhub.com/wp-content/uploads/2015/01/nature-wallpaper-3.jpg') no-repeat;    background-size: cover;    transition: 1s opacity;  }    video#bgvid.fillwidth {    width: 100%;    position: relative  }    nav {    background-color: black;    margin: 0;    overflow: hidden;  }    nav ul {    margin: 0;    padding: 0;  }    nav ul li {    list-style-type: none;  }    nav ul li {    color: white;    background-color: black;    display: block;    line-height: 1em;    padding: 1em 1.5em;    text-decoration: none;    letter-spacing: 0.15em;    font-size: 13px;  }    nav ul li a.logo {    background-color: black;  }    nav ul li a:hover {    background-color: ;  }    li {    float: right;  }    li:first-child {    float: left;  }    nav ul li img {    width: 16px;    height: 16px;    float: right;    margin-left: -20px;  }    .logo {    font-size: 20px;    letter-spacing: 0.1em;  }    .abstand-top {    margin-top: 10px;  }      }  nav ul li img {    width: 16px;    height: 16px;    float: right;    margin-left: -20px;  }  .logo {    font-size: 20px;    letter-spacing: 0.1em;  }  .abstand-top {    margin-top: 10px;  }
<nav>    <ul>      <li><a href="http://google.com/" class="logo">boomyeah</a></li>      <li class="abstand-top">        <a href="#"><img src="images/icon-facebook.svg" alt=""></a>      </li>      <li class="abstand-top">        <a href="#"><img src="images/icon-instagram.svg" alt=""></a>      </li>      <li class="abstand-top"><a href="http://google.com/">work   &nbsp; &nbsp; &nbsp;  |</a></li>      <li class="abstand-top"><a href="http://google.com/">about</a></li>      <li class="abstand-top"><a href="http://google.com/">crew</a></li>      <li class="abstand-top"><a href="http://google.com/">contact</a></li>    </ul>  </nav>    <div id="video-container">    <video id="bgvid" loop class="fillwidth" autoplay>  <source src=http://bigcom.com/assets/2014/08/ichooseb.mp4 type=video/mp4>  </video>  </div>

hope find solution.

  1. you didn't set position of nav absolute
  2. you set background color black, not transaper.
  3. you need set z-index make sure has higher z-index user can click on items in menu.

* {  	box-sizing: border-box;  	margin: 0;  	padding: 0;  }                    .row {              clear: both;          }                    .spalten-6 {              width: 49.99992%;          }            .spalten-12 {              width: 100%;          }                    .spalten-6,  .spalten-12           { float:left;}                .img-box img {              width: 100%;          }                    .img-box {              border-left: 2px solid white;              border-top: 2px solid white;          }              #video-container {      position: relative;      height:300px  }  #video-container {      top:0%;      left:0%;      height:100%;      width:100%;      overflow: hidden;    }  video#bgvid {      position:absolute;      z-index:-1;      background: url('http://ewallpaperhub.com/wp-content/uploads/2015/01/nature-wallpaper-3.jpg') no-repeat;      background-size: cover;      transition: 1s opacity;  }  video#bgvid.fillwidth {      width: 100%;     position:relative  }    nav {      margin: 0;      overflow: hidden;      position: absolute;      z-index: 10;  }    nav ul {      margin: 0;      padding: 0;  }    nav ul li {      list-style-type: none;  }    nav ul li {      color: white;      display: block;      line-height: 1em;      padding: 1em 1.5em;      text-decoration: none;      letter-spacing: 0.15em;      font-size: 13px;  }    nav ul li a.logo {      background-color: black;  }    nav ul li a:hover {      background-color: ;  }    li {      float: right;  }    li:first-child {      float: left;  }                   nav ul li img {             width: 16px;             height: 16px;             float: right;             margin-left: -20px;  }            .logo {              font-size: 20px;              letter-spacing: 0.1em;          }                    .abstand-top {              margin-top: 10px;                        }                  }                           nav ul li img {             width: 16px;             height: 16px;             float: right;             margin-left: -20px;  }            .logo {              font-size: 20px;              letter-spacing: 0.1em;          }                    .abstand-top {              margin-top: 10px;                        }
<nav>      <ul>          <li><a href="http://google.com/" class="logo">boomyeah</a></li>          <li class="abstand-top"><a href="#"><img src="images/icon-facebook.svg" alt=""></a></li>          <li class="abstand-top"><a href="#"><img src="images/icon-instagram.svg" alt=""></a></li>           <li class="abstand-top"><a href="http://google.com/">work   &nbsp; &nbsp; &nbsp;  |</a></li>          <li class="abstand-top"><a href="http://google.com/">about</a></li>          <li class="abstand-top"><a href="http://google.com/">crew</a></li>          <li class="abstand-top"><a href="http://google.com/">contact</a></li>               </ul>  </nav>      <div id="video-container">  <video id="bgvid" loop class="fillwidth" autoplay>  <source src=http://bigcom.com/assets/2014/08/ichooseb.mp4 type=video/mp4>  </video>   </div>


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -