JSFiddle - React, Tailwind, and code Playground
by Сергей Тарасевич
HTML
<label class="selectGeneral" placeholder="select your OS...">
<input type="radio" name="OS">
<div>
<input type="radio" name="OS" value="Linux" id="OS[Linux]">
<label for="OS[Linux]">linux</label>
<input type="radio" name="OS" value="Windows" id="OS[Windows]">
<label for="OS[Windows]">windows</label>
<input type="radio" name="OS" value="Other" id="OS[Other]">
<label for="OS[Other]">other</label>
</div>
</label>
CSS
* {
margin: 0;
padding: 0;
font-family: monospace;
}
/* Selects */
/* General Select */
label.selectGeneral {
display: block;
position: relative;
width: 250px;
height: 40px;
font-size: 18px;
font-weight: normal;
margin: 2px 0;
border: 3px solid #d6d6d6;
border-radius: 0;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
label.selectGeneral:before {
content: attr(placeholder);
display: inline-block;
position: absolute;
top: 0;
left: 0;
z-index: -1;
max-width: 100%;
height: 34px;
padding-left: 10px;
text-align: left;
line-height: 34px;
white-space: nowrap;
color: #adadad;
overflow-x: hidden;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
label.selectGeneral:after {
content:"<>";
display: inline-block;
position: absolute;
top: 0;
right: 0;
width: 34px;
height: 34px;
text-align: center;
line-height: 31px;
background-color: #ffffff;
border-bottom: 3px solid #d6d6d6;
-moz-box-sizing: border-box;
box-sizing: border-box;
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-ms-transform: rotate(90deg);
transform: rotate(90deg);
}
label.selectGeneral label {
display: inline-block;
min-width: 100%;
height: 34px;
font-size: 18px;
font-weight: normal;
line-height: 34px;
white-space: nowrap;
padding: 0 10px;
background-color: #ffffff;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
label.selectGeneral input, label.selectGeneral label {
display: none;
}
label.selectGeneral div {
min-width: 100%;
max-height: 500px;
overflow-x: hidden;
}
label.selectGeneral input[type="radio"]:checked ~ div {
position: absolute;
top: 34px;
z-index: 999;
overflow-y: auto;
box-shadow: -3px 0 0 #d6d6d6, 3px 0 0 #d6d6d6;
border-top: 3px solid #d6d6d6;
border-bottom: 3px solid...