title: How can I overlay logo over a image? using css
body: <p>As you can see the logo is displayed above the background-image, but i would like it to be in the center of the background image.</p>
  
  <p>this is my header and the background needs to begin on top of the page and end before the menu. the logo needs to be displayed in the center over the background image.
  i have tried a lot but maybe somebody had a similar problem and can help me with this.</p>
  
  <p><a href="https://i.stack.imgur.com/kFd5A.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kFd5A.jpg" alt="enter image description here"></a></p>
  
  <p>this image show the thats its almost working but its behind the background</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
  &lt;head&gt;
      
      &lt;meta charset="UTF-8"&gt;
    &lt;link rel='stylesheet' href='//fonts.googleapis.com/css?family=font1|font2|etc' type='text/css'&gt;
    &lt;link rel="stylesheet" href="styles.css" type="text/css"&gt;
    &lt;script src="navbar.js"&gt;&lt;/script&gt;
     &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"&gt;
      &lt;!--bootstrap--&gt; 
    &lt;link rel="stylesheet" type="text/css" href="styles/css/bootstrap.css"&gt;
    &lt;script src="styles/js/bootstrap.min.js"&gt;&lt;/script&gt;
     &lt;!--datepicker --&gt;
       &lt;link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"&gt;
    &lt;link rel="stylesheet" href="/resources/demos/style.css"&gt;
    &lt;script src="https://code.jquery.com/jquery-1.12.4.js"&gt;&lt;/script&gt;
    &lt;script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"&gt;&lt;/script&gt;
    &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"&gt;&lt;/script&gt;
    &lt;script src="styles/js/bootstrap.min.js"&gt;&lt;/script&gt;
    &lt;script&gt;
    $( function() {
      $( "#datepicker" ).datepicker();
    } );
    &lt;/script&gt;  
  
  &lt;/head&gt;
  &lt;body&gt;
  &lt;header&gt;
    
    
    &lt;div id="theCarousel" class="carousel slide" data-ride="carousel"&gt;
          &lt;img class="logo" src="fts.png"&gt;
    
        &lt;ol class="carousel-indicators"&gt;
            &lt;li data-target="#theCarousel" data-slide-to="0" class="active"&gt;
                
            &lt;/li&gt;
            &lt;li data-target="#theCarousel" data-slide-to="1"&gt;
                
            &lt;/li&gt;
            &lt;li data-target="#theCarousel" data-slide-to="2"&gt;
                
            &lt;/li&gt;          
        &lt;/ol&gt;
        &lt;div class="carousel-inner"&gt;
            &lt;div class="item active"&gt;
                &lt;div class="slide1"&gt;
                    &lt;div class="carousel-caption"&gt;
                    &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;
   &lt;div class="item"&gt;
                &lt;div class="slide2"&gt;
                    &lt;div class="carousel-caption"&gt;
                    &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;   
   &lt;div class="item"&gt;
                &lt;div class="slide3"&gt;
                    &lt;div class="carousel-caption"&gt;
                    &lt;/div&gt;
            &lt;/div&gt;
   &lt;/div&gt;&lt;/div&gt;
            
            &lt;a class="left carousel-control" href="#theCarousel"  data-slide="prev"&gt;
                &lt;span class="glyphicon glyphicon-chevron-left"&gt; &lt;/span&gt;&lt;/a&gt;
            
            &lt;a class="right carousel-control" href="#theCarousel"  data-slide="next"&gt;
                &lt;span class="glyphicon glyphicon-chevron-right"&gt; &lt;/span&gt; &lt;/a&gt;         
    &lt;/div&gt;
  &lt;/header&gt;
  &lt;div id="cssmenu" class="align-right"&gt;
    &lt;ul&gt;
    &lt;?php
      switch ($_SESSION['isAdmin']) { 
                  case "1":
                  echo '&lt;li&gt;&lt;a href="adminDash.php"&gt;&lt;i class="fa fa-unlock"&gt;&lt;/i&gt;&lt;span&gt;AdminDash&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;' ;
                  break;
  
                  case "0":
                  break;
  
                  default:
                  break;
              }
  
  ?&gt;
       &lt;li&gt;&lt;a href="index.php"&gt;&lt;span&gt;DASHBOARD&lt;/span&gt;&lt;i class="fa fa-home"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;
       &lt;li&gt;&lt;a href="acties/nieuwTicketDash.php"&gt;&lt;span&gt;&lt;i class="fa fa-ticket"&gt;&lt;/i&gt; NIEUW TICKET&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
       &lt;li&gt;&lt;a href="tickets.php"&gt;&lt;span&gt;ALLE TICKETS&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
       &lt;li&gt;&lt;a href="klanten.php"&gt;&lt;span&gt;&lt;/i&gt; KLANTEN&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
       &lt;li class="active"&gt;&lt;a href="acties/uitloggen.php"&gt;&lt;span&gt;&lt;i class="fa fa-sign-out"&gt;&lt;/i&gt;UITLOGGEN&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
   &lt;br&gt;&lt;br&gt;&lt;br&gt;
  &lt;/body&gt;
  
  &lt;style&gt;
  body {
    background-color: #cdcdcd;
    width: 100%;
    margin: 0 auto;
     
  }
  
  img.logo {
    height: 130px;
    position: absolute;
    margin: auto;
    display: block;
    top: 80px;
    left: 0;
    right: 0;
  }
  header{
    width: 100%;
    position: relative;
    text-align: center;
  }
    
    /* Carousel Styling */
  .carousel div[class^=slide] {
    height: 100px;
    width: 100%;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    position: relative;
    z-index: -1
  }
  
  .slide1{
    background-image: url('styles/3.jpg');
  }
  .slide2{
    background-image: url('styles/2.jpg');
  }
  .slide3{
    background-image: url('styles/1.png');
  }
  &lt;/style&gt;
    &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>