このサンプルのソース
HTML
<dl class="formSample01">
<dt>性別</dt>
<dd>
<ul>
<li><input type="radio" name="sex" id="man" /><label for="man">男性</label></li>
<li><input type="radio" name="sex" id="woman" /><label for="woman">女性</label></li>
</ul>
</dd>
</dl>
CSS
dl[class^="formSample"] {
margin: 20px 10px 50px;
padding: 10px;
background: rgba(100, 100, 100, .1);
border: 1px solid #fff;
border-radius: 10px;
-webkit-box-shadow: 0 0 5px #ccc;
font-size: 16px;
}
dl[class^="formSample"] dt {
font-weight: bold;
padding: 15px 15px 5px;
background: #fff;
}
dl[class^="formSample"] dt:first-of-type {
border-radius: 10px 10px 0 0;
}
dl[class^="formSample"] dd {
margin: 0;
padding: 0 15px 20px;
background: #fff;
}
dl[class^="formSample"] dd:last-of-type {
padding-bottom: 15px;
border-radius: 0 0 10px 10px;
}
dl[class^="formSample"] ul {
margin: 0;
padding: 0;
}
dl[class^="formSample"] li {
list-style: none;
margin: 0 0 5px;
padding: 0;
}
dl.formSample02 dd:after { content: ''; display: block; clear: both; }
dl.formSample02 dd li {
position: relative;
list-style: none;
float: left;
width: 50%;
}
dl.formSample02 dd label {
display: block;
padding: 10px 20px;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(0.5, #ddd), color-stop(0.5, #ccc), color-stop(1, #bbb));
border: 1px solid #fff;
border-radius: 10px 0 0 10px;
-webkit-box-shadow: 0 0 5px #aaa;
color: #333;
font-weight: bold;
text-shadow: 0 1px #fff;
text-align: center;
color: #555;
}
dl.formSample02 dd li:last-child label {
border-left: 0;
border-radius: 0 10px 10px 0;
}
dl.formSample02 dd input[type="radio"]:checked + label {
text-shadow: 0 -1px #fff;
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, rgba(100,100,100,.3)), color-stop(1, rgba(255,255,255,0)));
color: #111;
}
dl.formSample02 dd input[type="radio"] {
opacity : 0;
position: absolute;
top: -3px;
left: -3px;
width: 100%;
height: 100%;
padding: 0;
}
サンプル一覧に戻る