2015-10-06 6 views
1

Я пытаюсь удалить пустое пространство, которое у меня между плитками, как на картинке ниже:Удаление пустого пространства самозагрузки

enter image description here

Это то, что я в настоящее время:

enter image description here

Вот отметка для второй картины, которая в настоящее время имеет то, что у меня есть:

CSS

.mainbody-section { 
     padding-top: 30px; 
     padding-bottom: 30px; 
    } 

     /* Overlay text */ 
    .module { 
     background-color: lightgray; 
     background-attachment: fixed; 
     /*width: 400px;*/ 
     height: 300px; 
     position: relative; 
     overflow: hidden; 
     margin: 20px; 
    } 

     .module > header { 
      position: absolute; 
      bottom: 0; 
      left: 0; 
      width: 100%; 
      padding: 20px 10px; 
      background: inherit; 
      background-attachment: fixed; 
      overflow: hidden; 
     } 

      .module > header::before { 
       content: ""; 
       position: absolute; 
       top: -20px; 
       left: 0; 
       width: 200%; 
       height: 200%; 
       background: inherit; 
       background-attachment: fixed; 
       -webkit-filter: blur(4px); 
       filter: blur(4px); 
      } 

      .module > header::after { 
       content: ""; 
       position: absolute; 
       top: 0; 
       left: 0; 
       width: 100%; 
       height: 100%; 
       background: rgba(0, 0, 0, 0.25); 
      } 

      .module > header > h1 { 
       margin: 0; 
       color: white; 
       position: relative; 
       z-index: 1; 
      } 

      .module > header > h2 { 
       margin: 0; 
       color: white; 
       position: relative; 
       z-index: 1; 
      } 

    * { 
     box-sizing: border-box; 
    } 

HTML

<div class="mainbody-section text-center" style="padding-left: 50px; padding-right: 50px;"> 
<div class="row"> 
    <div class="col-lg-2 col-md-4 col-sm-6 hvr-wobble-to-bottom-right"> 
     <div class="module"> 
      <header> 
       <h1 style="font-size: 20px; text-align: center;">Test 
       </h1> 
       <h2 style="font-size: 13px; text-align: center;"> This is some sub-text 

       </h2>     
      </header>     
     </div> 
    </div> 
    <div class="col-lg-2 col-md-4 col-sm-6 hvr-wobble-to-bottom-right"> 
     <div class="module"> 
      <header> 
       <h1 style="font-size: 20px; text-align: center;">Test 
       </h1> 
       <h2 style="font-size: 13px; text-align: center;"> This is some sub-text 

       </h2>     
      </header>     
     </div> 
    </div> 
    <div class="col-lg-2 col-md-4 col-sm-6 hvr-wobble-to-bottom-right"> 
     <div class="module"> 
      <header> 
       <h1 style="font-size: 20px; text-align: center;">Test 
       </h1> 
       <h2 style="font-size: 13px; text-align: center;"> This is some sub-text 

       </h2>     
      </header>     
     </div> 
    </div> 
</div> 

Может кто-то пожалуйста, мне советы по пути, чтобы удалить все белое пространство между плитками?

Благодаря

+0

Вы пытались удалить '' margin' из .module'? –

+0

Да, у меня есть. Это удаляет его сверху и снизу, а не стороны ... – Code

ответ

2

.mainbody-section { 
 
     padding-top: 30px; 
 
     padding-bottom: 30px; 
 
    } 
 
.newClass{ 
 
     background-color: lightgray; 
 
     padding: 0px!important; 
 
     margin:0px!important; 
 
} 
 
.red{ 
 
    background-color: red!important; 
 
} 
 
     /* Overlay text */ 
 
    .module { 
 
     background-color: #abc; 
 
     background-attachment: fixed; 
 
     /*width: 400px;*/ 
 
     height: 300px; 
 
     position: relative; 
 
     overflow: hidden; 
 
    } 
 

 
     .module > header { 
 
      position: absolute; 
 
      bottom: 0; 
 
      left: 0; 
 
      width: 100%; 
 
      padding: 20px 10px; 
 
      background: inherit; 
 
      background-attachment: fixed; 
 
      overflow: hidden; 
 
     } 
 

 
      .module > header::before { 
 
       content: ""; 
 
       position: absolute; 
 
       top: -20px; 
 
       left: 0; 
 
       width: 200%; 
 
       height: 200%; 
 
       background: inherit; 
 
       background-attachment: fixed; 
 
       -webkit-filter: blur(4px); 
 
       filter: blur(4px); 
 
      } 
 

 
      .module > header::after { 
 
       content: ""; 
 
       position: absolute; 
 
       top: 0; 
 
       left: 0; 
 
       width: 100%; 
 
       height: 100%; 
 
       background: rgba(0, 0, 0, 0.25); 
 
      } 
 

 
      .module > header > h1 { 
 
       margin: 0; 
 
       color: white; 
 
       position: relative; 
 
       z-index: 1; 
 
      } 
 

 
      .module > header > h2 { 
 
       margin: 0; 
 
       color: white; 
 
       position: relative; 
 
       z-index: 1; 
 
      } 
 

 
    * { 
 
     box-sizing: border-box; 
 
    }
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"/> 
 
<div class="mainbody-section text-center" style="padding-left: 50px; padding-right: 50px;"> 
 
<div class="row"> 
 
    <div class="col-lg-2 col-md-4 col-sm-6 hvr-wobble-to-bottom-right newClass"> 
 
     <div class="module"> 
 
      <header> 
 
       <h1 style="font-size: 20px; text-align: center;">Test 
 
       </h1> 
 
       <h2 style="font-size: 13px; text-align: center;"> This is some sub-text 
 

 
       </h2>     
 
      </header>     
 
     </div> 
 
    </div> 
 
    <div class="col-lg-2 col-md-4 col-sm-6 hvr-wobble-to-bottom-right newClass"> 
 
     <div class="module red"> 
 
      <header> 
 
       <h1 style="font-size: 20px; text-align: center;">Test 
 
       </h1> 
 
       <h2 style="font-size: 13px; text-align: center;"> This is some sub-text 
 

 
       </h2>     
 
      </header>     
 
     </div> 
 
    </div> 
 
    <div class="col-lg-2 col-md-4 col-sm-6 hvr-wobble-to-bottom-right newClass"> 
 
     <div class="module"> 
 
      <header> 
 
       <h1 style="font-size: 20px; text-align: center;">Test 
 
       </h1> 
 
       <h2 style="font-size: 13px; text-align: center;"> This is some sub-text 
 

 
       </h2>     
 
      </header>     
 
     </div> 
 
    </div> 
 
</div>

http://jsfiddle.net/qbo8pk8j/3/

+0

Ха-ха, я понимаю, что вы сделали, это было бы нормально, но в итоге у меня будут разные цветные изображения, которые заменят серый фон. – Code

+0

Проверьте обновленный: http: //jsfiddle.net/qbo8pk8j/3/ – user1012181

+0

@Code: проверьте последний. Я думаю, это соответствовало бы вашим потребностям. – user1012181

2

Вот скрипка: http://jsfiddle.net/q5yfcs2p/

я удалил запас в .module и добавить пользовательский класс для col-*-*, потому что самозагрузки имеют Прокладки по швам , Этот класс .no-padding удаляет левый и правый.

.no-padding { 
    padding-left: 0; 
    padding-right: 0; 
} 
Смежные вопросы