Ajax Loader
×
HTML
<div class="block" style="height: 300px;">
1
<div class="block" style="height: 300px;">
2
    
3
    <div class="centered">
4
        <h1>Title one</h1>
5
        <p>But he stole up to us again, and suddenly clapping his hand on my shoulder, said&mdash;"Did ye see anything looking like men going towards that ship a while ago?"</p>
6
    </div>
7
    
8
</div>
9
 
10
<div class="block" style="height: 200px;">
11
    
12
    <div class="centered">
13
        <h1>Title two</h1>
14
        <p>But he stole up to us again, and suddenly clapping his hand on my shoulder, said&mdash;"Did ye see anything looking like men going towards that ship a while ago?"</p>
15
    </div>
16
    
17
</div>
18
 
19
<div class="block" style="height: 600px;">
20
    
21
    <div class="centered">
22
        <h1>Title three</h1>
23
        <p>But he stole up to us again, and suddenly clapping his hand on my shoulder, said&mdash;"Did ye see anything looking like men going towards that ship a while ago?"</p>
24
    </div>
25
</div>
 
CSS
.block {
1
.block {
2
  font-family:sans-serif;
3
  text-align: center;
4
  background: rgb(231, 76, 60);
5
  margin: 20px;
6
}
7
 
8
.block:before {
9
  content: '';
10
  display: inline-block;
11
  height: 100%; 
12
  vertical-align: middle;
13
  margin-right: -0.25em; /* Adjusts for spacing */
14
    
15
  /* For visualization 
16
  background: #808080; width: 5px;
17
  */
18
 }
19
 
20
.centered {
21
  display: inline-block;
22
  vertical-align: middle;
23
  width: 300px;
24
  padding: 10px 15px;
25
 
26
  background: rgb(192, 57, 43);
27
  color:#fff;
28
 }
 
JavaScript
jQuery(document).ready(function() {
1
jQuery(document).ready(function() {
2
  $('.link').click(function(event) {
3
    $('.box').toggleClass('active');
4
    
5
    e.preventDefault();
6
  });
7
});
 

Div align center

CSSDeck G+