Skip to content

Instantly share code, notes, and snippets.

@maxhoffmann
Created February 14, 2013 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxhoffmann/4953237 to your computer and use it in GitHub Desktop.
Save maxhoffmann/4953237 to your computer and use it in GitHub Desktop.
Moving arrow navigation with CSS only
/**
* Moving arrow navigation with CSS only
*/
ul {
position: relative;
margin: 3em 0;
list-style: none;
}
li {
display: inline-block;
left: 75px;
}
ul:hover li:not(:nth-of-type(2)) {
left: 120px;
}
li a {
padding: 0 1em;
text-decoration: none;
}
.arrow {
position: absolute;
left: inherit;
bottom: -8px;
width: 0;
height: 0;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-bottom: 5px solid red;
}
/* basic */
html {
font-family: sans-serif;
}
a {
color: #777;
}
<ul>
<li><a href="#1">Point 1</a></li><li><a href="#2">Point 2</a></li><li><a href="#3">Point 3</a></li><li><span class="arrow"></span></li>
</ul>
// alert('Hello world!');
{"view":"separate","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment