"Funky Radio/Checkbox Buttons V2.0"
Bootstrap 3.3.0 Snippet by momodinium

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="col-md-4">
<div class="col-md-6">
<h4>Radio Buttons</h4>
<div class="funkyradio">
<div class="funkyradio-default">
<input type="radio" name="radio" id="radio1" />
<label for="radio1">First Option default</label>
</div>
<div class="funkyradio-primary">
<input type="radio" name="radio" id="radio2" checked/>
<label for="radio2">Second Option primary</label>
</div>
<div class="funkyradio-success">
<input type="radio" name="radio" id="radio3" />
<label for="radio3">Third Option success</label>
</div>
<div class="funkyradio-danger">
<input type="radio" name="radio" id="radio4" />
<label for="radio4">Fourth Option danger</label>
</div>
<div class="funkyradio-warning">
<input type="radio" name="radio" id="radio5" />
<label for="radio5">Fifth Option warning</label>
</div>
<div class="funkyradio-info">
<input type="radio" name="radio" id="radio6" />
<label for="radio6">Sixth Option info</label>
</div>
</div>
</div>
<div class="col-md-6">
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
@import('https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.0/css/bootstrap.min.css')
.funkyradio div {
clear: both;
overflow: hidden;
}
.funkyradio label {
width: 100%;
border-radius: 3px;
border: 1px solid #D1D3D4;
font-weight: normal;
}
.funkyradio input[type="radio"]:empty,
.funkyradio input[type="checkbox"]:empty {
display: none;
}
.funkyradio input[type="radio"]:empty ~ label,
.funkyradio input[type="checkbox"]:empty ~ label {
position: relative;
line-height: 2.5em;
text-indent: 3.25em;
margin-top: 2em;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.funkyradio input[type="radio"]:empty ~ label:before,
.funkyradio input[type="checkbox"]:empty ~ label:before {
position: absolute;
display: block;
top: 0;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments:

What about validation? Standart bootstrap validation warnings not showing on checkboxes.

reasecret () - 4 years ago - Reply 0


Is there an easy way to show these as disabled? I can make them disabled so clicking on them does nothing, however I have to add extra CSS to change the pointer

baxter40 () - 5 years ago - Reply 0