how to add a div with information above the navbar with background Carousel

Asked

Viewed 145 times

1

I’m having a difficulty that although it seems to be simple but I’m not getting where I want, I’m creating a site where I have a div with the language card, in the middle of the logo and a reservation button, I have a Carousel that should be below that div and just below I have a navbar, the problem is that the Carousel does not stay down he pushes the div or gets on top and the navbar does not work click, someone could help me?

Como deve ficar

body {
  background: #ccc;
}
.topo { 
  height: 50px;
  background: transparent;
  color: #fff;
  z-index: 999; 
}
.topo .container{
  background: transparent !important;
}
.topo .row{
  background: transparent !important;
}
.nav {
  color:#fff;
}
.navbar {
  margin-bottom: 0;
  color:#fff !important;
}

.navbar {
  border-width: 0px !important;
  -webkit-box-shadow: 0px 0px !important;
  box-shadow: 0px 0px !important;
  background-color: rgba(0,0,0,0.0) !important;
  background-image: -webkit-gradient(linear, 50.00% 0.00%, 50.00% 100.00%, color-stop( 0% , rgba(0,0,0,0.00)),color-stop( 100% , rgba(0,0,0,0.00))) !important;
  background-image: -webkit-linear-gradient(270deg,rgba(0,0,0,0.00) 0%,rgba(0,0,0,0.00) 100%) !important;
  background-image: linear-gradient(180deg,rgba(0,0,0,0.00) 0%,rgba(0,0,0,0.00) 100%) !important;
}


 /*
Fade content bs-carousel with hero headers
Code snippet by maridlcrmn (Follow me on Twitter @maridlcrmn) for Bootsnipp.com
Image credits: unsplash.com
*/

/********************************/
/*       Fade Bs-carousel       */
/********************************/

.slider { margin-top: -100px !important; z-index: -999 !important;}

.fade-carousel {
  position: relative;
  height: 80vh; /*100vh*/
}
.fade-carousel .carousel-inner .item {
  height: 100vh;
}
.fade-carousel .carousel-indicators > li {
  margin: 0 2px;
  background-color: #f39c12;
  border-color: #f39c12;
  opacity: .7;
}
.fade-carousel .carousel-indicators > li.active {
width: 10px;
height: 10px;
opacity: 1;
}

/********************************/
/*          Hero Headers        */
/********************************/
.hero {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  color: #fff;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 rgba(0,0,0,.75);
    -webkit-transform: translate3d(-50%,-50%,0);
       -moz-transform: translate3d(-50%,-50%,0);
        -ms-transform: translate3d(-50%,-50%,0);
         -o-transform: translate3d(-50%,-50%,0);
            transform: translate3d(-50%,-50%,0);
}
.hero h1 {
  font-size: 6em;    
  font-weight: bold;
  margin: 0;
  padding: 0;
}

.fade-carousel .carousel-inner .item .hero {
  opacity: 0;
  -webkit-transition: 2s all ease-in-out .1s;
     -moz-transition: 2s all ease-in-out .1s; 
      -ms-transition: 2s all ease-in-out .1s; 
       -o-transition: 2s all ease-in-out .1s; 
          transition: 2s all ease-in-out .1s; 
}
.fade-carousel .carousel-inner .item.active .hero {
  opacity: 1;
  -webkit-transition: 2s all ease-in-out .1s;
     -moz-transition: 2s all ease-in-out .1s; 
      -ms-transition: 2s all ease-in-out .1s; 
       -o-transition: 2s all ease-in-out .1s; 
          transition: 2s all ease-in-out .1s;    
}

/********************************/
/*            Overlay           */
/********************************/
.overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 2;
  background-color: #080d15;
  opacity: .7;
}

/********************************/
/*          Custom Buttons      */
/********************************/
.btn.btn-lg {padding: 10px 40px;}
.btn.btn-hero,
.btn.btn-hero:hover,
.btn.btn-hero:focus {
  color: #f5f5f5;
  background-color: #1abc9c;
  border-color: #1abc9c;
  outline: none;
  margin: 20px auto;
}

/********************************/
/*       Slides backgrounds     */
/********************************/
.fade-carousel .slides .slide-1, 
.fade-carousel .slides .slide-2,
.fade-carousel .slides .slide-3 {
  height: 80vh; /*100*/
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;

  margin-top: -100px !important;
}
.fade-carousel .slides .slide-1 {
  background-image: url(https://ununsplash.imgix.net/photo-1416339134316-0e91dc9ded92?q=75&fm=jpg&s=883a422e10fc4149893984019f63c818); 
}
.fade-carousel .slides .slide-2 {
  background-image: url(https://ununsplash.imgix.net/photo-1416339684178-3a239570f315?q=75&fm=jpg&s=c39d9a3bf66d6566b9608a9f1f3765af);
}
.fade-carousel .slides .slide-3 {
  background-image: url(https://ununsplash.imgix.net/photo-1416339276121-ba1dfa199912?q=75&fm=jpg&s=9bf9f2ef5be5cb5eee5255e7765cb327);
}

/********************************/
/*          Media Queries       */
/********************************/
@media screen and (min-width: 980px){
  .hero { width: 980px; }    
}
@media screen and (max-width: 640px){
  .hero h1 { font-size: 4em; }    
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>          
<div class="topo">
  <div class="container text-center">
    <div class="row">
      <div class="col-md-4">
        idiomas
      </div>
      <div class="col-md-4">
        logo
      </div>
      <div class="col-md-4">
        botao reserva
      </div>
    </div>
  </div>
</div>

<!--  Inicio do Navbar -->
<nav class="navbar navbar-default"><!-- navbar-fixed-top -->
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <!--
      <a class="navbar-brand" href="#">
      <img class="img-responsive" src="images/logo.png" alt="">
      </a>
      -->
    </div>
    <div id="navbar" class="navbar-collapse collapse">
      <ul class="nav navbar-nav navbar-right">
        <li><a href="#quem-somos">Quem somos</a></li>
        <li><a href="#oque-oferecemos">O que oferecemos</a></li>
        <li><a href="#depoimento">Depoimentos </a></li>
        <li><a href="#mapa">Contato</a></li> 
      </ul>
    </div><!--/.nav-collapse -->
  </div>
</nav>
<!--  Fim do Navbar -->

<!-- inicio carousel --> 
<div class="slider">
  <div class="carousel fade-carousel slide" data-ride="carousel" data-interval="4000" id="bs-carousel">
    <!-- Overlay -->
    <div class="overlay"></div>

    <!-- Indicators -->
    <ol class="carousel-indicators">
      <li data-target="#bs-carousel" data-slide-to="0" class="active"></li>
      <li data-target="#bs-carousel" data-slide-to="1"></li>
      <li data-target="#bs-carousel" data-slide-to="2"></li>
    </ol>
    
    <!-- Wrapper for slides -->
    <div class="carousel-inner">
      <div class="item slides active">
        <div class="slide-1"></div>
        <div class="hero">
          <hgroup>
            <h1>We are creative</h1>        
            <h3>Get start your next awesome project</h3>
          </hgroup>
          <button class="btn btn-hero btn-lg" role="button">See all features</button>
        </div>
      </div>
      <div class="item slides">
        <div class="slide-2"></div>
        <div class="hero">        
          <hgroup>
            <h1>We are smart</h1>        
            <h3>Get start your next awesome project</h3>
          </hgroup>       
          <button class="btn btn-hero btn-lg" role="button">See all features</button>
        </div>
      </div>
      <div class="item slides">
        <div class="slide-3"></div>
        <div class="hero">        
          <hgroup>
            <h1>We are amazing</h1>        
            <h3>Get start your next awesome project</h3>
          </hgroup>
          <button class="btn btn-hero btn-lg" role="button">See all features</button>
        </div>
      </div>
    </div> 
  </div>
</div>
<!-- Fim carousel -->

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.