Ajax Loader
HTML
<h1>Simple CSS accordion</h1>
1
<h1>Simple CSS accordion</h1>
2
<!-- Start of the accordion -->
3
<div id="container">
4
<!-- Item 1 -->
5
  <div class="accordion">
6
    <label for="tm" class="accordionitem">
7
    <h2>Item 1 <span class="arrow">&raquo;</span></h2></label>
8
    <input type="checkbox" id="tm"/>
9
    <p class="hiddentext">One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed  into a horrible vermin. He lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches into stiff sections.</p>
10
  </div>
11
  
12
  <!-- Item 2 -->
13
  <div class="accordion">
14
    <label for="tn" class="accordionitem">
15
    <h2>Item 2 <span class="arrow">&raquo;</span></h2></label>
16
    <input type="checkbox" id="tn"/>
17
    <p class="hiddentext">One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed into a horrible vermin. He lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches into stiff sections.</p>
18
  </div>
19
  
20
  <!-- Item 3 -->
21
  <div class="accordion">
22
    <label for="to" class="accordionitem">
23
    <h2>Item 3 <span class="arrow">&raquo;</span></h2></label>
24
    <input type="checkbox" id="to"/>
25
    <p class="hiddentext">One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed into a horrible vermin. He lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches into stiff sections.</p>
26
  </div>
27
</div>
 
CSS
*{
1
*{
2
  margin: 0; border: 0;
3
}
4
h1{
5
  text-align: center;
6
  margin-top: 10%
7
}
8
p{
9
  color: #666;
10
}
11
#container{
12
  width: 400px;
13
  height: auto;
14
  margin: 0 auto;
15
  margin-top: 3%;
16
  border-top: 1px solid #bdbdbd;
17
  border-left: 1px solid #bdbdbd;
18
  border-right: 1px solid #bdbdbd;
19
}
20
.accordion label{
21
  display:block;
22
  background-color: #eeeeee;
23
  padding: 10px;
24
  color: #424242;
25
  text-shadow: 0 0 2px rgba(255,255,255,0.6);
26
  cursor: pointer;
27
  border-bottom: 1px solid #bdbdbd;
28
  border-top: 1px solid #ffffff;
29
}
30
 
31
.accordion p{
32
  color: #424242;
33
  padding: 10px;
34
  font-size: 0.8em;
35
  line-height: 1.7em;
36
  border-bottom: 1px solid #bdbdbd;
37
  visibility: hidden;
38
  opacity: 0;
39
  display: none;
40
  text-align: left;
41
  background-color: #fff;
42
  margin-top: 0px;
43
}
44
 
45
#tm:checked ~ .hiddentext{
46
  display: block;
47
  visibility: visible;
48
  opacity: 1;
49
}
50
 
51
input#tm{
52
  display: none;
53
  position: relative;
54
}
55
 
56
#tn:checked ~ .hiddentext{
57
  display: block;
58
  visibility: visible;
59
  opacity: 1;
60
}
61
 
62
input#tn{
63
  display: none;
64
  position: relative;
65
}
66
 
67
#to:checked ~ .hiddentext{
68
  display: block;
69
  visibility: visible;
70
  opacity: 1;
71
}
72
 
73
input#to{
74
  display: none;
75
  position: relative;
76
}
 

CSS accordion no-js

CSSDeck G+