CSS Step by Step Menu (Wizard Style)
Here is another way to create CSS based step by step or wizard style menu without any images, just using pure CSS. It works perfectly with themed web apps that need to be quickly and easily updated.
CSS Wizard Menu Preview:
Wizard Steps HTML
<div class="wizard-steps"> <div class="completed-step"><a href="#step-one"><span>1</span> Account Info</a></div> <div class="active-step"><a href="#step-two"><span>2</span> Contact Info</a></div> <div><a href="#"><span>3</span> Security Question</a></div> <div><a href="#"><span>4</span> Confirmation</a></div> </div>
Wizard Steps CSS
CSS may seem long but is actually pretty simple. Therefore, instead of focusing on each line of code I’ll walk you through the “cool” part—the arrows! Those are created using CSS pseudo elements :before and :after which are used to insert some content before and after the target element content.
In this case our target element is “.wizard-steps a” which is just a rectangle containing a <span> container for the step number and some text. Just after it is the arrow
and before it is the negative space of the arrow
. If you take a closer look at the code starting on line 48, you’ll notie that those two shapes are created by manipulating border properties. For more details how this technique works reference my Write Smarter HTML & CSS post.
/* = STEPS CONTAINER
----------------------------*/
.wizard-steps {
margin:20px 10px 0px 10px;
padding:0px;
position: relative;
clear:both;
font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: bold;
}
.wizard-steps div {
position:relative;
}
/* = STEP NUMBERS
----------------------------*/
.wizard-steps span {
display: block;
float: left;
font-size: 10px;
text-align:center;
width:15px;
margin: 2px 5px 0px 0px;
line-height:15px;
color: #ccc;
background: #FFF;
border: 2px solid #CCC;
-webkit-border-radius:10px;
-moz-border-radius:10px;
border-radius:10px;
}
/* = DEFAULT STEPS
----------------------------*/
.wizard-steps a {
position:relative;
display:block;
width:auto;
height:24px;
margin-right: 18px;
padding:0px 10px 0px 3px;
float: left;
font-size:11px;
line-height:24px;
color:#666;
background: #F0EEE3;
text-decoration:none;
text-shadow:1px 1px 1px rgba(255,255,255, 0.8);
}
.wizard-steps a:before {
width:0px;
height:0px;
border-top: 12px solid #F0EEE3;
border-bottom: 12px solid #F0EEE3;
border-left:12px solid transparent;
position: absolute;
content: "";
top: 0px;
left: -12px;
}
.wizard-steps a:after {
width: 0;
height: 0;
border-top: 12px solid transparent;
border-bottom: 12px solid transparent;
border-left:12px solid #F0EEE3;
position: absolute;
content: "";
top: 0px;
right: -12px;
}
/* = COMPLETED STEPS
----------------------------*/
.wizard-steps .completed-step a {
color:#163038;
background: #A3C1C9;
}
.wizard-steps .completed-step a:before {
border-top: 12px solid #A3C1C9;
border-bottom: 12px solid #A3C1C9;
}
.wizard-steps .completed-step a:after {
border-left: 12px solid #A3C1C9;
}
.wizard-steps .completed-step span {
border: 2px solid #163038;
color: #163038;
text-shadow:none;
}
/* = ACTIVE STEPS
----------------------------*/
.wizard-steps .active-step a {
color:#A3C1C9;
background: #163038;
text-shadow:1px 1px 1px rgba(0,0,0, 0.8);
}
.wizard-steps .active-step a:before {
border-top: 12px solid #163038;
border-bottom: 12px solid #163038;
}
.wizard-steps .active-step a:after {
border-left: 12px solid #163038;
}
.wizard-steps .active-step span {
color: #163038;
-webkit-box-shadow:0px 0px 2px rgba(0,0,0, 0.8);
-moz-box-shadow:0px 0px 2px rgba(0,0,0, 0.8);
box-shadow:0px 0px 2px rgba(0,0,0, 0.8);
text-shadow:none;
border: 2px solid #A3C1C9;
}
/* = HOVER STATES
----------------------------*/
.wizard-steps .completed-step:hover a, .wizard-steps .active-step:hover a {
color:#fff;
background: #8F061E;
text-shadow:1px 1px 1px rgba(0,0,0, 0.8);
}
.wizard-steps .completed-step:hover span, .wizard-steps .active-step:hover span {
color:#8F061E;
}
.wizard-steps .completed-step:hover a:before, .wizard-steps .active-step:hover a:before {
border-top: 12px solid #8F061E;
border-bottom: 12px solid #8F061E;
}
.wizard-steps .completed-step:hover a:after, .wizard-steps .active-step:hover a:after {
border-left: 12px solid #8F061E;
}
You can edit the HTML and CSS to add disabled step class or add JavaScript to make incomplete steps inactive. Play with it, use it, and let me know what you think!
Download
Downlad packaged example which includes a small jQuery snippet that disables clicks on inactive steps. Cheers!

Allen
How do I get my download. I payed the amount and did not get a download option.
eplicanic
Thanks Allen!!! You should get an email shortly. Cheers!
Jennifer
Nice work.. love how you created the arrows!
eplicanic
Thanks Jennifer!
Jennifer
How do I get the arrows to be taller?
eplicanic
Adjust border widths inside :before/:after selectors until you get the result you want. Take a look at this post http://www.emirplicanic.com/css/write-smarter-html-css towards the bottom of the page. I hope this helps. PS: Thanks for supporting the script ;)
jenney
Your transaction ID for this payment is: 0J489970WB6035337.
sakshi
nice work…appreciate you…thank you SO MUCHHH…. love you for this… and http://www.emirplicanic.com/php/php-mysql-search-script also…
thanks once again…
Roger Mori
From the downloaded code the menu works fine, but from the application the arrows are not showing up.
My application is set to run in IE7 compatibitlity mode.
Any ideas?
Please advise.
Amar Sheriff
HI eplicanic – I made the payment. Can you please send me the download link or send the sample to my email.. Thanks / Amar
Your transaction ID for this payment is: 7S638937W7160480T.
Paul
Nice! How do you align the whole div () to the right? Can’t get that to work, I wonder what I’m doing wrong.
Thanks,
Matt Ruby
Thanks for posting this. It’s really helpful.
Quick question, do you know how to remove the thin grey outline on the arrows?
Matt Ruby
I found the solution on: http://css-tricks.com/snippets/css/css-triangle/
Use border-style of inset on the transparent borders
Ivar
Excellent guide but i have one quick css-question: How do i center the wizard?