0

Currently I'm trying to make it so that my content from .wrap-artist displays above the background image with a blur.

CSS

.wrap-artwork {
    left: 0;
    right: 0;
    z-index: 1;
    display: block;
    background-image: url('https://i1.sndcdn.com/artworks-000183268921-teibnr-t500x500.jpg');
    background-size: cover;
    background-position:center;
    height: 150px;
    margin-bottom: 20px;
    margin-top: -1px;
    margin-right: -16px;
    margin-left: -16px;
    -webkit-filter: blur(8px);
    -moz-filter: blur(8px);
    -o-filter: blur(8px);
    -ms-filter: blur(8px);
    filter: blur(8px);
}

.wrap-artist {
    position: relative;
    left: 0;
    right: 0;
    z-index: 9999;
    margin-left: 20px;
    margin-right: 20px;
}

.container {
   margin-top: 25px;
   max-width: 100%;
   margin-left: auto;
   margin-right: auto;
   background-color: #ffffff;
   border: 1px solid #ddd;
   width: 1080px;
   overflow: hidden;
   padding-bottom: 25px;
}

I've tried messing around with the positions but with the structure I'm using it doesn't seem to be working at all.

HTML

<div class="container">
    <div class="wrap-artwork"></div>
        <div class="wrap-artist">
        this is our image content
        </div>
    <div class="col-md-8">
        some other content here     
    </div>

    <div class="col-md-4">
        finally some sidebar content here
    </div>
</div>

Hopefully someone can help me, I used this question for guiding me but must have miss understood something in the first answer.

    .wrap-artwork {
  left: 0;
  right: 0;
  z-index: 1;
  display: block;
  background-image: url('https://i1.sndcdn.com/artworks-000183268921-teibnr-t500x500.jpg');
  background-size: cover;
  background-position:center;
  height: 150px;
  margin-bottom: 20px;
  margin-top: -1px;
  margin-right: -16px;
  margin-left: -16px;
  -webkit-filter: blur(8px);
  -moz-filter: blur(8px);
  -o-filter: blur(8px);
  -ms-filter: blur(8px);
  filter: blur(8px);
 }
 
    .wrap-artist {
  position: relative;
  left: 0;
  right: 0;
  z-index: 9999;
  margin-left: 20px;
  margin-right: 20px;
    }

    .container {
       margin-top: 25px;
       max-width: 100%;
       margin-left: auto;
       margin-right: auto;
       background-color: #ffffff;
       border: 1px solid #ddd;
       width: 1080px;
       overflow: hidden;
       padding-bottom: 25px;
    }
<div class="container">
  <div class="wrap-artwork"></div>
   <div class="wrap-artist">
   this is our image content
   </div>
  <div class="col-md-8">
   some other content here  
  </div>
  
  <div class="col-md-4">
   finally some sidebar content here
  </div>
</div>
Community
  • 1
  • 1
Wayward
  • 19
  • 6

2 Answers2

0

You want something like that ? : See this fiddle

If so, you have to add relative position to the .container parent and replace relative position to absolute with top property on .wrap-artist class.

.wrap-artist {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    margin-left: 20px;
    margin-right: 20px;
}

.container {
   margin-top: 25px;
   max-width: 100%;
   margin-left: auto;
   margin-right: auto;
   background-color: #ffffff;
   border: 1px solid #ddd;
   width: 1080px;
   overflow: hidden;
   padding-bottom: 25px;
   position: relative;
}
Vincent G
  • 8,547
  • 1
  • 18
  • 36
  • Thank you so much! I'm so annoyed that it was such an easy fix and I literally spent an hour and 20 minutes trying to figure out an answer.. – Wayward Mar 10 '17 at 09:18
  • You're welcome! It's often like that, thanks to SO community for providing help to fix problems when we can't find the solution :) – Vincent G Mar 10 '17 at 09:22
0

Are you looking for something like this? I added the row class..

.wrap-artwork {
  left: 0;
  right: 0;
  z-index: 1;
  display: block;
  background-image: url('https://i1.sndcdn.com/artworks-000183268921-teibnr-t500x500.jpg');
  background-size: cover;
  background-position:center;
  height: 150px;
  margin-bottom: 20px;
  margin-top: -1px;
  margin-right: -16px;
  margin-left: -16px;
  -webkit-filter: blur(8px);
  -moz-filter: blur(8px);
  -o-filter: blur(8px);
  -ms-filter: blur(8px);
  filter: blur(8px);
 }
 
    .wrap-artist {
  position: absolute;
    color: white;
    font-size: 19px;
    font-weight: bold;
    top: 160px;
  left: 0;
  right: 0;
  z-index: 9999;
  margin-left: 20px;
  margin-right: 20px;
    }

    .container {
       margin-top: 25px;
       max-width: 100%;
       margin-left: auto;
       margin-right: auto;
       background-color: #ffffff;
       border: 1px solid #ddd;
       width: 1080px;
       overflow: hidden;
       padding-bottom: 25px;
    }
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<div class="container">
  <div class="row">
  <div class="wrap-artwork col-md-12">
    </div>
   <div class="wrap-artist">
     this is our image content
   </div>
  </div>
  <div class="row">
  <div class="col-md-8">
   some other content here  
  </div>
  
  <div class="col-md-4">
   finally some sidebar content here
  </div>
  </div>
</div>
Serge Inácio
  • 1,366
  • 9
  • 22