styled radio buttons
by ringstaff
HTML
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.0/css/bootstrap.min.css">
<form class="form-signin" action="firstLogin.action" method="post">
<h2 class="form-signin-heading">Please sign in</h2>
<input type="text" class="form-control" name="username" placeholder="User Name" required autofocus>
<br>
<input type="password" class="form-control" name="password" required placeholder="Password">
<br>
<nav class="segmented-button">
<input type="radio" name="seg-1" value="Organisation" id="seg-Organisation" required>
<label for="seg-Organisation" class="first">Admin</label>
<input type="radio" name="seg-1" value="Tags" id="seg-Tags" required>
<label for="seg-Tags" class="last">User</label>
</nav>
<div>
<br>
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
</form>
CSS
input:required,
textarea:required {
border-color: red !important;
}
.segmented-button {
padding: 12px;
}
.segmented-button input[type="radio"] {
width: 0px;
height: 0px;
display: none;
}
.segmented-button label {
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
vertical-align: middle;
*vertical-align: auto;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
-o-border-radius: 4px;
-ms-border-radius: 4px;
-khtml-border-radius: 4px;
border-radius: 4px;
text-shadow: white;
background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #e4e4e4));
background: -webkit-linear-gradient(#ffffff, #e4e4e4);
background: -moz-linear-gradient(#ffffff, #e4e4e4);
background: -o-linear-gradient(#ffffff, #e4e4e4);
background: -ms-linear-gradient(#ffffff, #e4e4e4);
background: linear-gradient(#ffffff, #e4e4e4);
border: 1px solid #b2b2b2;
color: #666666;
padding: 5px 24px;
padding-bottom: 3px;
font-size: 12px;
cursor: pointer;
font-family: Helvetica;
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
-o-border-radius: 0px;
-ms-border-radius: 0px;
-khtml-border-radius: 0px;
border-radius: 0px;
margin-right: -5px;
}
.segmented-button label {
*display: inline;
}
.segmented-button label:hover {
-moz-box-shadow: 0 0 5px 1px rgba(0, 0, 0, 0.1);
-webkit-box-shadow: 0 0 5px 1px rgba(0, 0, 0, 0.1);
-o-box-shadow: 0 0 5px 1px rgba(0, 0, 0, 0.1);
box-shadow: 0 0 5px 1px rgba(0, 0, 0, 0.1);
color: #333333;
}
.segmented-button label:active, .segmented-button label.active {
background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #e4e4e4), color-stop(100%, #ffffff));
background: -webkit-linear-gradient(#e4e4e4, #ffffff);
background: -moz-linear-gradient(#e4e4e4, #ffffff);
background: -o-linear-gradient(#e4e4e4, #ffffff);
background: -ms-linear-gradient(#e4e4e4, #ffffff);
background: linear-gradient(#e4e4e4,...