galaxy/Radio-buttons/Pradeepsaranbishnoi_selfish-ladybug-61.html

74 lines
1.3 KiB
HTML

<div class="container">
<form>
<label>
<input type="radio" name="radio" checked="">
<span>HTML</span>
</label>
<label>
<input type="radio" name="radio">
<span>CSS</span>
</label>
<label>
<input type="radio" name="radio">
<span>Javascript</span>
</label>
</form>
</div>
<style>
/* From Uiverse.io by Pradeepsaranbishnoi - Tags: radio */
.container form {
display: flex;
flex-wrap: wrap;
flex-direction: column;
}
.container label {
display: flex;
cursor: pointer;
font-weight: 500;
position: relative;
overflow: hidden;
margin-bottom: 0.375em;
}
.container label input {
position: absolute;
left: -9999px;
}
.container label input:checked + span {
background-color: #414181;
color: white;
}
.container label input:checked + span:before {
box-shadow: inset 0 0 0 0.4375em #00005c;
}
.container label span {
display: flex;
align-items: center;
padding: 0.375em 0.75em 0.375em 0.375em;
border-radius: 99em;
transition: 0.25s ease;
color: #414181;
}
.container label span:hover {
background-color: #d6d6e5;
}
.container label span:before {
display: flex;
flex-shrink: 0;
content: "";
background-color: #fff;
width: 1.5em;
height: 1.5em;
border-radius: 50%;
margin-right: 0.375em;
transition: 0.25s ease;
box-shadow: inset 0 0 0 0.125em #00005c;
}
</style>