Created
July 26, 2018 04:13
-
-
Save togakangaroo/57e624fdc4f9a71f6a658cb25c5920bb to your computer and use it in GitHub Desktop.
// source http://jsbin.com/bacohuz
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
<style id="jsbin-css"> | |
ul { | |
list-style-type: none; | |
padding: 0; | |
display: inline-flex; | |
font-size: 50px; | |
outline: 1px solid red; | |
width: 5em; | |
overflow: hidden; | |
} | |
ul:hover { | |
outline: 2px solid blue; | |
} | |
ul:hover > li:nth-child(1) { | |
margin-left: -5em; | |
} | |
li:before { | |
content: "★"; | |
} | |
li:nth-child(1) { | |
margin-left: 0em; | |
} | |
li:nth-last-child(n+5) { | |
color: gray; | |
} | |
li:nth-last-child(-1n+5) { | |
color: red; | |
} | |
li:nth-last-child(-1n+5):hover ~ * { | |
color: yellow; | |
} | |
</style> | |
<ul> | |
<li></li> | |
<li></li> | |
<li></li> | |
<li></li> | |
<li></li> | |
<li></li> | |
<li></li> | |
<li></li> | |
<li></li> | |
<li></li> | |
</ul> | |
<script id="jsbin-source-css" type="text/css">ul { | |
list-style-type: none; | |
padding:0; | |
display: inline-flex; | |
font-size: 50px; | |
outline: 1px solid red; | |
width: 5em; | |
overflow: hidden; | |
&:hover { | |
outline: 2px solid blue; | |
&>li:nth-child(1) { | |
margin-left: -5em; | |
} | |
} | |
} | |
li { | |
&:before { | |
content: "★"; | |
} | |
&:nth-child(1) { | |
margin-left: 0em; | |
} | |
&:nth-last-child(n+5) { | |
color: gray; | |
} | |
&:nth-last-child(-1n+5) { | |
color: red; | |
&:hover ~ * { | |
color: yellow; | |
} | |
} | |
} | |
</script> |
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
ul { | |
list-style-type: none; | |
padding: 0; | |
display: inline-flex; | |
font-size: 50px; | |
outline: 1px solid red; | |
width: 5em; | |
overflow: hidden; | |
} | |
ul:hover { | |
outline: 2px solid blue; | |
} | |
ul:hover > li:nth-child(1) { | |
margin-left: -5em; | |
} | |
li:before { | |
content: "★"; | |
} | |
li:nth-child(1) { | |
margin-left: 0em; | |
} | |
li:nth-last-child(n+5) { | |
color: gray; | |
} | |
li:nth-last-child(-1n+5) { | |
color: red; | |
} | |
li:nth-last-child(-1n+5):hover ~ * { | |
color: yellow; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment