Question :
How to get what comes after my NAV , so as not to swim?
Introduction:
I am building a small reusable progress tracking module that needs to be connected to some tools that are created for internal use from our firewall.
While cross-browser compatibility is good, we need encode against Chrome and Firefox. These are the only browsers officially supported by our technical team.
In addition, ANY and ALL suggestions for improvement are always welcome.
Task: FLOATS !!
In order for the arrows to display correctly and behave intuitively, I had to edit using li .
(from "had", I mean "could not think of a better way" :)
To prevent the whole NAV from moving to the right, I had to leave a float. Now, no matter what happens after the navigation is right there, enter it.
Note:
You can also see and play the code here on jsFiddle .
Code:
HTML:
<nav id="progress_tracker"> <ul> <li><a href='#'>Grab a beer</a></li> <li><a href='#'>Work a little more</a></li> <li><a href='#' class="current">Take a Nap</a></li> <li><a href='#' class="complete">Work like a dog</a></li> <li><a href='#' class="complete">Grab a coffee</a></li> </ul> </nav>
CSS
nav { float: left; } nav#progress_tracker { padding: 0.25em; background-color: #1a3340; border-radius: 1.75em; } nav ul li:last-child{ margin-left: -1.7em; } nav ul{ list-style-type: none; } nav ul li{ display: inline-block; float: right; position: relative; padding: 0; margin: 0; } nav ul li a{ display: inline-block; vertical-align: middle; color: #777; background-color: DDD; padding-top: 0.75em; padding-bottom: 0.75em; padding-left: 2em; padding-right: 1em; line-height: 1.5em; } nav ul li a:after{ width: 0; height: 0; position: absolute; top: 0; right: -1em; border-left: 1em solid #d9d9d9; border-top: 1.5em inset transparent; border-bottom: 1.5em inset transparent; content: ""; } nav ul li a:visited{ color: #888888; } nav ul li a.current{ font-weight: bold; color: #777; background-color: #FFBB00; } nav ul li a.current:after{ border-left: 1em solid #FFBF00; } nav ul li a.complete{ color: #666; background-color: #FFFFEE; } nav ul li a.complete:after{ border-left: 1em solid #FFFFEF; } nav ul li:last-child a{ border-top-left-radius: 1.45em; border-bottom-left-radius: 1.45em; } nav ul li:first-child a{ border-top-right-radius: 1.45em; border-bottom-right-radius: 1.45em; } nav ul li:first-child a:after{ border: none; }
Thanks-a-bunch.
source share