A Pen by JowayYoung on CodePen.
Created
November 3, 2019 12:08
-
-
Save mqxu/9d42726cc058b866dd2e2b3d8181c704 to your computer and use it in GitHub Desktop.
【iCSS:行为】使用+或~美化选项框
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="bruce flex-ct-x"> | |
<ul class="beauty-selection"> | |
<li> | |
<input type="radio" name="radioName" id="fed-engineer" hidden> | |
<label for="fed-engineer"></label> | |
<span>前端工程师</span> | |
</li> | |
<li> | |
<input type="radio" name="radioName" id="bed-engineer" hidden> | |
<label for="bed-engineer"></label> | |
<span>后端工程师</span> | |
</li> | |
<li> | |
<input type="radio" name="radioName" id="fsd-engineer" hidden> | |
<label for="fsd-engineer"></label> | |
<span>全栈工程师</span> | |
</li> | |
</ul> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.beauty-selection { | |
display: flex; | |
li { | |
display: flex; | |
align-items: center; | |
margin-left: 20px; | |
&:first-child { | |
margin-left: 0; | |
} | |
} | |
input:checked + label { | |
background-color: #f90; | |
} | |
label { | |
margin-right: 5px; | |
padding: 2px; | |
border: 1px solid #f90; | |
border-radius: 100%; | |
width: 18px; | |
height: 18px; | |
background-clip: content-box; | |
cursor: pointer; | |
transition: all 300ms; | |
&:hover { | |
border-color: #09f; | |
background-color: #09f; | |
box-shadow: 0 0 7px #09f; | |
} | |
} | |
span { | |
font-size: 16px; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="https://yangzw.vip/static/css/reset.css" rel="stylesheet" /> | |
<link href="https://yangzw.vip/static/css/main.css" rel="stylesheet" /> | |
<link href="https://yangzw.vip/static/css/theme.scss" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment