Ajax Loader
×
HTML
<!DOCTYPE html>
1
<!DOCTYPE html>
2
<!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
3
<!--[if IE 7]> <html class="lt-ie9 lt-ie8" lang="en"> <![endif]-->
4
<!--[if IE 8]> <html class="lt-ie9" lang="en"> <![endif]-->
5
<!--[if gt IE 8]><!--> <html lang="en"> <!--<![endif]-->
6
<head>
7
  <meta charset="utf-8">
8
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
9
  <title>Toggle Switches</title>
10
  <!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
11
</head>
12
<body>
13
  <div class="container">
14
    <div class="switch">
15
      <input type="radio" class="switch-input" name="view" value="week" id="week" checked>
16
      <label for="week" class="switch-label switch-label-off">Week</label>
17
      <input type="radio" class="switch-input" name="view" value="month" id="month">
18
      <label for="month" class="switch-label switch-label-on">Month</label>
19
      <span class="switch-selection"></span>
20
    </div>
21
 
22
    <div class="switch switch-blue">
23
      <input type="radio" class="switch-input" name="view2" value="week2" id="week2" checked>
24
      <label for="week2" class="switch-label switch-label-off">Week</label>
25
      <input type="radio" class="switch-input" name="view2" value="month2" id="month2">
26
      <label for="month2" class="switch-label switch-label-on">Month</label>
27
      <span class="switch-selection"></span>
28
    </div>
29
 
30
    <div class="switch switch-yellow">
31
      <input type="radio" class="switch-input" name="view3" value="week3" id="week3" checked>
32
      <label for="week3" class="switch-label switch-label-off">Week</label>
33
      <input type="radio" class="switch-input" name="view3" value="month3" id="month3">
34
      <label for="month3" class="switch-label switch-label-on">Month</label>
35
      <span class="switch-selection"></span>
36
    </div>
37
  </div>
38
</body>
39
</html>
40
 
 
CSS
/*
1
/*
2
 * Copyright (c) 2012-2013 Thibaut Courouble
3
 * http://www.webinterfacelab.com
4
 *
5
 * Licensed under the MIT License:
6
 * http://www.opensource.org/licenses/mit-license.php
7
 *
8
 * View the Sass/SCSS source at:
9
 * http://demo.webinterfacelab.com/21-toggle-switches/scss/
10
 *
11
 * Original PSD by Orman Clark: http://goo.gl/MNFHK
12
 */
13
 
14
@import "http://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.css";
15
 
16
body {
17
  font: 13px/20px "Lucida Grande", Tahoma, Verdana, sans-serif;
18
  color: #404040;
19
  background: #363a41;
20
}
21
 
22
.container {
23
  margin: 60px auto;
24
  width: 120px;
25
}
26
 
27
.switch {
28
  position: relative;
29
  margin: 20px auto;
30
  height: 26px;
31
  width: 120px;
32
  background: rgba(0, 0, 0, 0.25);
33
  border-radius: 3px;
34
  -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px rgba(255, 255, 255, 0.1);
35
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px rgba(255, 255, 255, 0.1);
36
}
37
 
38
.switch-label {
39
  position: relative;
40
  z-index: 2;
41
  float: left;
42
  width: 58px;
43
  line-height: 26px;
44
  font-size: 11px;
45
  color: rgba(255, 255, 255, 0.35);
46
  text-align: center;
47
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
48
  cursor: pointer;
49
}
50
 
51
.switch-label:active {
52
  font-weight: bold;
53
}
54
 
55
.switch-label-off {
56
  padding-left: 2px;
57
}
58
 
59
.switch-label-on {
60
  padding-right: 2px;
61
}
62
 
63
/*
64
 * Note: using adjacent or general sibling selectors combined with
65
 *       pseudo classes doesn't work in Safari 5.0 and Chrome 12.
66
 *       See this article for more info and a potential fix:
67
 *       http://css-tricks.com/webkit-sibling-bug/
68
 */
69
 
70
.switch-input {
71
  display: none;
72
}
73
 
74
.switch-input:checked + .switch-label {
75
  font-weight: bold;
76
  color: rgba(0, 0, 0, 0.65);
77
  text-shadow: 0 1px rgba(255, 255, 255, 0.25);
78
  -webkit-transition: 0.15s ease-out;
79
  -moz-transition: 0.15s ease-out;
80
  -o-transition: 0.15s ease-out;
81
  transition: 0.15s ease-out;
82
}
83
 
84
.switch-input:checked + .switch-label-on ~ .switch-selection {
85
  /* Note: left: 50% doesn't transition in WebKit */
86
  left: 60px;
87
}
88
 
89
.switch-selection {
90
  display: block;
91
  position: absolute;
92
  z-index: 1;
93
  top: 2px;
94
  left: 2px;
95
  width: 58px;
96
  height: 22px;
97
  background: #65bd63;
98
  border-radius: 3px;
99
  background-image: -webkit-linear-gradient(top, #9dd993, #65bd63);
100
  background-image: -moz-linear-gradient(top, #9dd993, #65bd63);
101
  background-image: -o-linear-gradient(top, #9dd993, #65bd63);
102
  background-image: linear-gradient(to bottom, #9dd993, #65bd63);
103
  -webkit-box-shadow: inset 0 1px rgba(255, 255, 255, 0.5), 0 0 2px rgba(0, 0, 0, 0.2);
104
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.5), 0 0 2px rgba(0, 0, 0, 0.2);
105
  -webkit-transition: left 0.15s ease-out;
106
  -moz-transition: left 0.15s ease-out;
107
  -o-transition: left 0.15s ease-out;
108
  transition: left 0.15s ease-out;
109
}
110
 
111
.switch-blue .switch-selection {
112
  background: #3aa2d0;
113
  background-image: -webkit-linear-gradient(top, #4fc9ee, #3aa2d0);
114
  background-image: -moz-linear-gradient(top, #4fc9ee, #3aa2d0);
115
  background-image: -o-linear-gradient(top, #4fc9ee, #3aa2d0);
116
  background-image: linear-gradient(to bottom, #4fc9ee, #3aa2d0);
117
}
118
 
119
.switch-yellow .switch-selection {
120
  background: #c4bb61;
121
  background-image: -webkit-linear-gradient(top, #e0dd94, #c4bb61);
122
  background-image: -moz-linear-gradient(top, #e0dd94, #c4bb61);
123
  background-image: -o-linear-gradient(top, #e0dd94, #c4bb61);
124
  background-image: linear-gradient(to bottom, #e0dd94, #c4bb61);
125
}
126
 
 

Untitled

CSSDeck G+