<html>
<head>
<script src="http://zeptojs.com/zepto.min.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<title>Radio / Checkbox style in WebKit</title>
<link rel="stylesheet" href="http://melchoyce.github.io/dashicons/css/dashicons.css">
<style>
input[type=checkbox],
input[type=radio] {
box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
background-color: #fff;
color: #333;
outline: 0;
transition: .05s border-color ease-in-out;
transition: .05s border-color ease-in-out
}
input[type=checkbox]:focus,
input[type=radio]:focus {
border-color: #5b9dd9;
box-shadow: 0 0 2px rgba(30,140,190,.8);
box-shadow: 0 0 2px rgba(30,140,190,.8)
}
input[type=checkbox],
input[type=radio] {
border: 1px solid #bbb;
background: #fff;
color: #555;
clear: none;
cursor: pointer;
display: inline-block;
line-height: 0;
height: 16px;
margin: -4px 4px 0 0;
outline: 0;
padding: 0!important;
text-align: center;
vertical-align: middle;
width: 16px;
min-width: 16px;
appearance: none;
box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
transition: .05s border-color ease-in-out;
transition: .05s border-color ease-in-out
}
input[type=radio] {
border-radius: 50%;
border-radius: 50%;
margin-right: 4px;
line-height: 10px
}
input[type=checkbox]:checked:before,
input[type=radio]:checked:before {
float: left;
display: inline-block;
vertical-align: middle;
width: 16px;
font: 400 21px/1 dashicons;
speak: none;
font-smoothing: antialiased;
osx-font-smoothing: grayscale
}
input[type=checkbox]:checked:before {
content: '\f147';
margin: -3px 0 0 -4px;
color: #1e8cbe
}
input[type=radio]:checked:before {
content: '\2022';
text-indent: -9999px;
border-radius: 50px;
border-radius: 50px;
font-size: 24px;
width: 6px;
height: 6px;
margin: 4px;
line-height: 16px;
background-color: #1e8cbe
}
</style>
<body>
<p>
<input type="radio" name="aa"/> 这是一个单选框
<input type="radio" name="aa"/> 这是一个单选框
</p>
<p>
<input type="checkbox" name="checkme[]"> 选我
<input type="checkbox" name="checkme[]"> 选我
<input type="checkbox" name="checkme[]"> 选我
<input type="checkbox" name="checkme[]"> 选我
</p>
</body>
</html>
Output
This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account
Dismiss xKeyboard Shortcuts
Shortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + ] | Indents selected lines |
ctrl + [ | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + shift + L | Beautify code in active panel |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Open the share options |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
JS Bin URLs
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |