CSS for step wizard - html

I am new to CSS and I need help to develop step wizard as displayed below. Please provide me pointers to the same.
Here is the sample code that I have tried: https://jsfiddle.net/61peq3d6/1/
.wizard li {
background-color: #fff;
border: solid black 3px;
border-radius: 5px;
display: inline;
padding: 10px 30px 10px 40px;
margin-right: -7px;
width: auto;
color: teal;
}
.wizard li::before,
.wizard li::after {
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
border-color: transparent;
border-left-color: #000;
border-radius: 10px;
}
.wizard li::before {
border-width: 25px;
margin-top: -16px;
margin-left: 84px;
}
.wizard li::after {
border-left-color: #fff;
border-width: 21px;
margin-top: -12px;
margin-left: 24px;
}
.wizard li.selected {
background-color: black;
color: #fff;
}
.wizard li.selected::after {
border-left-color: black;
}
.wizard li:last-child::after {
border-left-color: transparent;
}
<ul class="wizard">
<li>Passo 1</li>
<li class="selected">Passo 2</li>
<li>Passo 3</li>
<li>Passo 4</li>
<li>Fim</li>
</ul>
I am facing issue in aligning the arrow kind of sign.

Got the answer: DEMO
HTML CODE:
<div class="form-wizard centered-pills">
<ul class="nav nav-pills">
<li role="presentation" class="completed">1. Contact Information</li>
<li role="presentation" class="current">2. Product Information</li>
<li role="presentation" >3. Confirmation</li>
</ul>
</div>
CSS:
.form-wizard {
margin: 0 auto;
display: block;
margin-bottom: 25px;
}
.form-wizard .nav li {
box-shadow: 0 5px 3px -3px #ddd;
}
.form-wizard .nav li + li {
margin-left: 0;
}
.form-wizard .nav li:first-child a {
padding-left: 10px;
}
.form-wizard .nav li:last-child a {
border-right: 1px solid #000;
}
.form-wizard .nav li:last-child:after, .form-wizard .nav li:last-child:before {
border-width: 0;
}
.form-wizard .nav li:last-child:hover:after, .form-wizard .nav li:last-child:hover:before {
border-width: 0;
}
.form-wizard .nav li:last-child:hover a {
border-right: 1px solid #000;
}
.form-wizard .nav li a {
border-radius: 0;
padding-left: 30px;
background: #fff;
border: 1px solid #000;
color: teal;
border-right: 0;
}
.form-wizard .nav li a:hover, .form-wizard .nav li a:active, .form-wizard .nav li a:focus {
background: teal;
color: white;
}
.form-wizard .nav li:after, .form-wizard .nav li:before {
content: "";
border-color: transparent transparent transparent #000;
border-style: solid;
border-width: 20px;
position: absolute;
display: block;
top: 0;
z-index: 1;
}
.form-wizard .nav li:after {
border-left-color: #fff;
top: 1px;
right: -39px;
}
.form-wizard .nav li:before {
border-width: 21px;
right: -41px;
}
.form-wizard .nav li.completed a {
border-radius: 0;
padding-left: 30px;
background: #fff;
border: 1px solid #000;
border-right: 0;
color: teal;
cursor: pointer;
}
.form-wizard .nav li.completed:after, .form-wizard .nav li.completed:before {
content: "";
border-color: transparent transparent transparent #000;
border-style: solid;
border-width: 20px;
position: absolute;
display: block;
top: 0;
right: -40px;
z-index: 1;
}
.form-wizard .nav li.completed:after {
border-left-color: #fff;
top: 1px;
right: -39px;
}
.form-wizard .nav li.completed:before {
border-width: 21px;
right: -41px;
}
.form-wizard .nav li.current a {
border-radius: 0;
padding-left: 30px;
background: #000;
border: 1px solid #000;
border-right: 0;
color: white;
cursor: pointer;
}
.form-wizard .nav li.current:after, .form-wizard .nav li.current:before {
content: "";
border-color: transparent transparent transparent #000;
border-style: solid;
border-width: 20px;
position: absolute;
display: block;
top: 0;
right: -40px;
z-index: 1;
}
.form-wizard .nav li.current:after {
border-left-color: #000;
top: 1px;
right: -39px;
}
.form-wizard .nav li.current:before {
border-width: 21px;
right: -41px;
}
.form-wizard .nav li.current:last-child a {
border-right: 1px solid #000;
}
.form-wizard .nav li.current:last-child:after, .form-wizard .nav li.current:last-child:before {
border-width: 0;
}
.form-wizard .nav li.current:last-child:hover:after, .form-wizard .nav li.current:last-child:hover:before {
border-width: 0;
}
.form-wizard .nav li.current:last-child:hover a {
border-right: 1px solid #000;
}

Related

Add a border to the shape in CSS [duplicate]

Fiddle here
I'm trying to set the border color of some irregular shapes (arrowish) I did. The problem is that to achieve those shapes I had to manipulate the borders already so I can't just do border-color: red;
I want to set the color of the borders of each shape 2px
HTML:
<div class="menuTop">
<ul>
<li><div>HOME</div></li>
<li><div>Location</div></li>
<li><div><span>Sub-Location<span></div></li>
</ul>
</div>
CSS:
.menuTop {
background-color: lightgreen;
height: 80px;
margin: auto;
position: absolute;
top: 0;
width: 100%
}
.menuTop ul {
list-style-type: none;
}
.menuTop li {
font-size: 0;
display: inline-block;
}
.menuTop li:before,
.menuTop li:after {
content:'';
display: inline-block;
width:0;
height:0;
border-top: 20px solid transparent;
border-bottom: 20px solid transparent;
border-left: 20px solid transparent;
border-right: 20px solid transparent;
vertical-align: middle;
}
.menuTop li:before {
border-top-color: #fff;
border-bottom-color: #fff;
border-right-color: #fff;
}
.menuTop li:first-of-type:before {
border:0;
}
.menuTop li:first-of-type {
border-left: 2px solid #dfdfdf;
}
.menuTop li:after {
border-left-color: #fff;
}
.menuTop li:last-of-type:after {
border:0;
}
.menuTop li:last-of-type {
border-right: 2px solid #F37C31;
border-bottom: 2px solid #F37C31;
border-top: 2px solid #F37C31;
}
.menuTop li div {
width: 185px;
height:40px;
display: inline-block;
background: #fff;
text-align:center;
position: relative;
line-height:40px;
vertical-align: middle;
}
.menuTop li div a, span {
text-decoration: none;
color: #bbb;
font-family: 'open sans', sans-serif;
font-weight: 400;
font-size: 13px;
}
.menuTop li div a:hover {
text-decoration: underline;
color: #000;
}
.menuTop li div span {
color: #000;
font-weight: bold;
}
CSS solution with rectangles
Here is an example that does not use triangles, but instead uses rotated rectangle.
Explanation:
First the before and after create a rotated rectangle.
Give the before rectangle the same color as the background.
After element gets the same color as the arrow.
Then we can apply borders to rectangles to give the perfect illusion of the elements having the border.
body {
background-color: #555;
}
.menu {
display: inline-block;
margin: 0;
padding: 0;
}
.menu .arrow {
position: relative;
display: inline-block;
list-style: none;
font-size: 2em;
width: 150px;
height: 70px;
background-color: white;
margin-right: 90px;
border-top: 2px solid red;
border-bottom: 2px solid red;
}
.arrow:first-of-type {
border-left: 2px solid red;
}
.arrow::after {
position: absolute;
top: 9px;
right: -25px;
content: "";
height: 50px;
width: 50px;
background-color: white;
transform: rotate(45deg);
border-right: 2px solid red;
border-top: 2px solid red;
}
.arrow::before {
content: "";
position: absolute;
top: 9px;
left: -25px;
height: 50px;
width: 50px;
background-color: #555; /*Needs to match body backgrond-color*/
transform: rotate(45deg);
border-right: 2px solid red;
border-top: 2px solid red;
}
.arrow:first-of-type::before {
content: none;
}
.arrow span {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
<ul class="menu">
<li class="arrow"><span>Text</span>
</li>
<li class="arrow"><span>Text</span>
</li>
<li class="arrow"><span>Text</span>
</li>
</ul>

How make triangle div with css [duplicate]

This question already has answers here:
How to make this arrow in CSS only?
(5 answers)
Closed 6 years ago.
How can i achieve the effect in the below image using css
parent div with divs with triangle egde like in the picture below. if i can achieve this with JS am also open to any good idea
* {
margin: 0;
}
a {
color: #333;
text-decoration: none;
}
nav {
background: #eee;
overflow: hidden;
}
nav li {
display: inline-block;
vertical-align: top;
position: relative;
}
nav li:after {
content: " ";
position: absolute;
right: 0;
top: 0;
bottom: 0;
width: 40px;
transform: rotate(45deg);
background: #999;
}
nav a {
display: block;
padding: 14px 20px;
position: relative;
z-index: 1;
}
nav li a:before {
content: " ";
position: absolute;
right: 3px;
top: 0;
bottom: 0;
width: 40px;
transform: rotate(45deg);
background: #eee;
z-index: -1;
}
<nav>
<ul>
<li>Jewelry and watches
</li>
<li>watches
</li>
<li>Jewelry
</li>
<li>Wrist watches
</li>
</ul>
</nav>
Or you can even simplify it by using one psudo element and using the border property
* {
margin: 0;
}
a {
color: #333;
text-decoration: none;
}
nav {
background: #eee;
overflow: hidden;
box-shadow: 0px 0px 3px 2px rgba(0,0,0,0.25);
margin: 15px;
}
nav li {
display: inline-block;
vertical-align: top;
position: relative;
}
nav li:after {
content: " ";
position: absolute;
right: 0px;
top: -1px;
bottom: 0;
width: 30px;
transform: rotate(45deg);
background: transparent;
height: 30px;
border-right: 1px solid #999;
border-top: 1px solid #999;
}
nav a {
display: block;
padding: 5px 20px;
position: relative;
z-index: 1;
}
<nav>
<ul>
<li>Jewelry and watches
</li>
<li>watches
</li>
<li>Jewelry
</li>
<li>Wrist watches
</li>
</ul>
</nav>
Try this one
HTML
<ul class="breadcrumb">
<li>Home</li>
<li>Vehicles</li>
<li>Vans</li>
<li>Camper Vans</li>
<li>1989 VW Westfalia Vanagon</li>
</ul>
CSS
.breadcrumb {
list-style: none;
overflow: hidden;
font: 18px Helvetica, Arial, Sans-Serif;
}
.breadcrumb li {
float: left;
}
.breadcrumb li a {
color: white;
text-decoration: none;
padding: 10px 0 10px 65px;
background: brown; /* fallback color */
background: hsla(34,85%,35%,1);
position: relative;
display: block;
float: left;
}
.breadcrumb li a:after {
content: " ";
display: block;
width: 0;
height: 0;
border-top: 50px solid transparent; /* Go big on the size, and let overflow hide */
border-bottom: 50px solid transparent;
border-left: 30px solid hsla(34,85%,35%,1);
position: absolute;
top: 50%;
margin-top: -50px;
left: 100%;
z-index: 2;
}
.breadcrumb li a:before {
content: " ";
display: block;
width: 0;
height: 0;
border-top: 50px solid transparent;
border-bottom: 50px solid transparent;
border-left: 30px solid white;
position: absolute;
top: 50%;
margin-top: -50px;
margin-left: 1px;
left: 100%;
z-index: 1;
}
.breadcrumb li:first-child a {
padding-left: 10px;
}
.breadcrumb li:nth-child(2) a { background: hsla(34,85%,45%,1); }
.breadcrumb li:nth-child(2) a:after { border-left-color: hsla(34,85%,45%,1); }
.breadcrumb li:nth-child(3) a { background: hsla(34,85%,55%,1); }
.breadcrumb li:nth-child(3) a:after { border-left-color: hsla(34,85%,55%,1); }
.breadcrumb li:nth-child(4) a { background: hsla(34,85%,65%,1); }
.breadcrumb li:nth-child(4) a:after { border-left-color: hsla(34,85%,65%,1); }
.breadcrumb li:nth-child(5) a { background: hsla(34,85%,75%,1); }
.breadcrumb li:nth-child(5) a:after { border-left-color: hsla(34,85%,75%,1); }
.breadcrumb li:last-child a {
background: transparent !important;
color: black;
pointer-events: none;
cursor: default;
}
.breadcrumb li a:hover { background: hsla(34,85%,25%,1); }
.breadcrumb li a:hover:after { border-left-color: hsla(34,85%,25%,1) !important; }

Border on custom shape

Fiddle here
I'm trying to set the border color of some irregular shapes (arrowish) I did. The problem is that to achieve those shapes I had to manipulate the borders already so I can't just do border-color: red;
I want to set the color of the borders of each shape 2px
HTML:
<div class="menuTop">
<ul>
<li><div>HOME</div></li>
<li><div>Location</div></li>
<li><div><span>Sub-Location<span></div></li>
</ul>
</div>
CSS:
.menuTop {
background-color: lightgreen;
height: 80px;
margin: auto;
position: absolute;
top: 0;
width: 100%
}
.menuTop ul {
list-style-type: none;
}
.menuTop li {
font-size: 0;
display: inline-block;
}
.menuTop li:before,
.menuTop li:after {
content:'';
display: inline-block;
width:0;
height:0;
border-top: 20px solid transparent;
border-bottom: 20px solid transparent;
border-left: 20px solid transparent;
border-right: 20px solid transparent;
vertical-align: middle;
}
.menuTop li:before {
border-top-color: #fff;
border-bottom-color: #fff;
border-right-color: #fff;
}
.menuTop li:first-of-type:before {
border:0;
}
.menuTop li:first-of-type {
border-left: 2px solid #dfdfdf;
}
.menuTop li:after {
border-left-color: #fff;
}
.menuTop li:last-of-type:after {
border:0;
}
.menuTop li:last-of-type {
border-right: 2px solid #F37C31;
border-bottom: 2px solid #F37C31;
border-top: 2px solid #F37C31;
}
.menuTop li div {
width: 185px;
height:40px;
display: inline-block;
background: #fff;
text-align:center;
position: relative;
line-height:40px;
vertical-align: middle;
}
.menuTop li div a, span {
text-decoration: none;
color: #bbb;
font-family: 'open sans', sans-serif;
font-weight: 400;
font-size: 13px;
}
.menuTop li div a:hover {
text-decoration: underline;
color: #000;
}
.menuTop li div span {
color: #000;
font-weight: bold;
}
CSS solution with rectangles
Here is an example that does not use triangles, but instead uses rotated rectangle.
Explanation:
First the before and after create a rotated rectangle.
Give the before rectangle the same color as the background.
After element gets the same color as the arrow.
Then we can apply borders to rectangles to give the perfect illusion of the elements having the border.
body {
background-color: #555;
}
.menu {
display: inline-block;
margin: 0;
padding: 0;
}
.menu .arrow {
position: relative;
display: inline-block;
list-style: none;
font-size: 2em;
width: 150px;
height: 70px;
background-color: white;
margin-right: 90px;
border-top: 2px solid red;
border-bottom: 2px solid red;
}
.arrow:first-of-type {
border-left: 2px solid red;
}
.arrow::after {
position: absolute;
top: 9px;
right: -25px;
content: "";
height: 50px;
width: 50px;
background-color: white;
transform: rotate(45deg);
border-right: 2px solid red;
border-top: 2px solid red;
}
.arrow::before {
content: "";
position: absolute;
top: 9px;
left: -25px;
height: 50px;
width: 50px;
background-color: #555; /*Needs to match body backgrond-color*/
transform: rotate(45deg);
border-right: 2px solid red;
border-top: 2px solid red;
}
.arrow:first-of-type::before {
content: none;
}
.arrow span {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
<ul class="menu">
<li class="arrow"><span>Text</span>
</li>
<li class="arrow"><span>Text</span>
</li>
<li class="arrow"><span>Text</span>
</li>
</ul>

Breadcrumbs arrow rtl direction

I modified the code Breadcrumbs arrow for working in right to left direction but text not working fine this code in jsfiddle look how text show : jsfiddle.net/tr7th3d2
<style>
.breadcrumb {
list-style: none;
overflow: hidden;
font: 18px Helvetica, Arial, Sans-Serif;
}
.breadcrumb li {
float: left;
}
.breadcrumb li a {
color: white;
text-decoration: none;
padding: 10px 0 10px 55px;
background: brown; /* fallback color */
background: hsla(34,85%,35%,1);
position: relative;
display: block;
float: left;
}
.breadcrumb li a:after {
content: " ";
display: block;
width: 0;
height: 0;
border-top: 50px solid transparent; /* Go big on the size, and let overflow hide */
border-bottom: 50px solid transparent;
border-right: 30px solid hsla(34,85%,35%,1);
position: absolute;
top: 50%;
margin-top: -50px;
right: 100%;
z-index: 2;
}
.breadcrumb li a:before {
content: " ";
display: block;
width: 0;
height: 0;
border-top: 50px solid transparent; /* Go big on the size, and let overflow hide */
border-bottom: 50px solid transparent;
border-right: 30px solid white;
position: absolute;
top: 50%;
margin-top: -50px;
margin-right: 1px;
right: 100%;
z-index: 1;
}
.breadcrumb li:first-child a {
padding-right: 10px;
}
.breadcrumb li:nth-child(2) a { background: hsla(34,85%,45%,1); }
.breadcrumb li:nth-child(2) a:after { border-right-color: hsla(34,85%,45%,1); }
.breadcrumb li:nth-child(3) a { background: hsla(34,85%,55%,1); }
.breadcrumb li:nth-child(3) a:after { border-right-color: hsla(34,85%,55%,1); }
.breadcrumb li:nth-child(4) a { background: hsla(34,85%,65%,1); }
.breadcrumb li:nth-child(4) a:after { border-right-color: hsla(34,85%,65%,1); }
.breadcrumb li:nth-child(5) a { background: hsla(34,85%,75%,1); }
.breadcrumb li:nth-child(5) a:after { border-right-color: hsla(34,85%,75%,1); }
.breadcrumb li a:hover { background: hsla(34,85%,25%,1); }
.breadcrumb li a:hover:after { border-right-color: hsla(34,85%,25%,1) !important; }
</style>
<div id="page-wrap">
<ul class="breadcrumb">
<li>Home</li>
<li>Vehicles</li>
<li>Vans</li>
<li>Camper Vans</li>
<li>1989 VW Westfalia Vanagon</li>
</ul>
</div>
and this original code :
https://css-tricks.com/triangle-breadcrumbs/
you must change a tag padding
.breadcrumb li a {
padding: 10px 55px 10px 0px;
}

link on li and align vertical: middle

I am working on this step by step pattern and I am having some issues aligning the text to be in the middle as you can see here: https://jsfiddle.net/54vtc0n0/
I tried the align-vertical:middle but that did not work for me, maybe I did it wrong? Do any of you have any ideas on how to align this?
Also, I want to link the blue steps to a url so when you click on the validated step it takes you to a page. However it looks like I can't have an href on an li pointing to an outside page. I really need this to link to a url. Does anyone knows a work around.
Thanks in advance
HTML:
<!doctype html>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<div id="crumbs">
<ul>
<li class="blue">Start <i class="fa fa-check-circle-o fa-lg" style = "align: right" ></i></li>
<li >About you </li>
<li class= "grey">Plans</li>
<li class= "grey">Details</li>
<li class="grey">Enroll</li>
</ul>
</div>
</div>
CSS:
#crumbs ul {
list-style: none;
display: inline-table;
}
#crumbs ul li {
display: inline;
}
#crumbs ul li a {
display: block;
float: left;
background: #3498db;
text-align: rigth;
padding: 25px 15px 0 40px;
position: relative;
margin: 0 0px 5px 0;
font-family: Arial;
font-size: 16px;
text-decoration: none;
color: #fff;
padding-right: 5px;
padding-bottom: 5px;
}
#crumbs ul li a:after {
content: "";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid #009bda;
position: absolute; right: -25px; top: 0;
z-index: 1;
}
#crumbs ul li a:before {
content: "";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid #fff;
position: absolute; left: 0; top: 0;
}
#crumbs ul li:first-child a {
border-top: 0px; border-bottom: 0px;
}
#crumbs ul li:first-child a:before {
display: none;
}
#crumbs ul li:last-child a {
padding-right: 8px;
padding-bottom: 5px;
border-top-right-radius: 0px; border-bottom: 0px;
}
#crumbs ul li:last-child a:after {
display: none;
}
#crumbs ul li a:hover {
background: #ed5338;
}
#crumbs ul li a:hover:after {
border-left-color: #ed5338;
}
<!-----------------------The non active state-------------------------->
#crumbs ul li.notactive {
display: inline;
}
#crumbs ul li.notactive a {
display: block;
float: left;
background: #d1d1ce;
text-align: rigth;
padding: 25px 15px 0 60px;
position: relative;
margin: 0 0px 5px 0;
font-family: Arial;
font-size: 16px;
text-decoration: none;
color: #fff;
padding-right: 5px;
padding-bottom: 5px;
}
#crumbs ul li.notactive a:after {
content: "";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid #d1d1ce;
position: absolute; right: -25px; top: 0;
z-index: 1;
}
#crumbs ul li.notactive a:before {
content: "";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid transparent;
position: absolute; left: 0; top: 0;
}
#crumbs ul li.notactive:first-child a {
border-top: 0px; border-bottom: 0px;
}
#crumbs ul li.notactive:first-child a:before {
display: none;
}
#crumbs ul li.notactive:last-child a {
padding-right: 10px;
padding-bottom: 5px;
border-top-right-radius: 0px; border-bottom: 0px;
}
#crumbs ul li.notactive:last-child a:after {
display: none;
}
#crumbs ul li a:hover {
background: #ed5338;
}
#crumbs ul li a:hover:after {
border-left-color: #ed5338;
}
<!-------------------Blue box------------------------->
#crumbs ul li.blue {
display: inline;
}
#crumbs ul li.blue a {
display: block;
float: left;
background: #009bda;
text-align: rigth;
padding: 25px 15px 0 60px;
position: relative;
margin: 0 0px 5px 0;
font-family: Arial;
font-size: 16px;
text-decoration: none;
color: #fff;
padding-right: 5px;
padding-bottom: 5px;
}
<!-------------------Grey box------------------------->
#crumbs ul li.grey {
display: inline;
}
#crumbs ul li.grey a {
display: block;
float: left;
background: #d1d1ce;
text-align: rigth;
padding: 25px 15px 0 60px;
position: relative;
margin: 0 0px 5px 0;
font-family: Arial;
font-size: 16px;
text-decoration: none;
color: #fff;
padding-right: 5px;
padding-bottom: 5px;
}
#crumbs ul li.grey a:after {
content: "";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid #d1d1ce;
position: absolute; right: -25px; top: 0;
z-index: 1;
}
#crumbs ul li.grey a:before {
content: "";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid transparent;
position: absolute; left: 0; top: 0;
}
So using this simple tutorial which I googled:
https://css-tricks.com/triangle-breadcrumbs/
I was able to recreate your "breadcrumbs" by changing the colours..
https://jsfiddle.net/54vtc0n0/2/
(Credit goes to author of tutorial: Chris Coyier)
You can use java script to change the active link/tab colour by changing the css for that tab, for example:
HTML
<ul class="breadcrumb">
<li>Start</li>
<li>About you</li>
<li>Plans</li>
<li>Details</li>
<li>Enroll</li>
</ul>
CSS:
.breadcrumb {
list-style: none;
overflow: hidden;
font: 18px Helvetica, Arial, Sans-Serif;
}
.breadcrumb li {
float: left;
}
.breadcrumb li a {
color: white;
text-decoration: none;
padding: 10px 0 10px 65px;
background: #009BDA;
position: relative;
display: block;
float: left;
}
.breadcrumb li a:after {
content: " ";
display: block;
width: 0;
height: 0;
border-top: 50px solid transparent; /* Go big on the size, and let overflow hide */
border-bottom: 50px solid transparent;
border-left: 30px solid #009BDA;
position: absolute;
top: 50%;
margin-top: -50px;
left: 100%;
z-index: 2;
}
.breadcrumb li a:before {
content: " ";
display: block;
width: 0;
height: 0;
border-top: 50px solid transparent;
border-bottom: 50px solid transparent;
border-left: 30px solid white;
position: absolute;
top: 50%;
margin-top: -50px;
margin-left: 1px;
left: 100%;
z-index: 1;
}
.breadcrumb li:first-child a {
padding-left: 10px;
}
.breadcrumb li:nth-child(2) a { background: #D1D1CE; }
.breadcrumb li:nth-child(2) a:after { border-left-color: #D1D1CE; }
.breadcrumb li:nth-child(3) a { background: #D1D1CE; }
.breadcrumb li:nth-child(3) a:after { border-left-color: #D1D1CE; }
.breadcrumb li:nth-child(4) a { background: #D1D1CE; }
.breadcrumb li:nth-child(4) a:after { border-left-color: #D1D1CE; }
.breadcrumb li:nth-child(5) a { background: #D1D1CE; }
.breadcrumb li:nth-child(5) a:after { border-left-color: #D1D1CE; }
.breadcrumb li a:hover { background: #A5A5A5; }
.breadcrumb li a:hover:after { border-left-color: #A5A5A5 !important; }
Also a little advice when formatting your css, each css rule should not be tabbed in.. it is not HTML. Unless you're using something like media queries or SASS when its needed then go ahead.
Your padding is making the text does not centered vertically
So you can adjust it like this:
*{
box-sizing: border-box;
}
#crumbs ul {
display: inline-table;
}
#crumbs ul li {
display:table-cell;
vertical-align: middle;
}
#crumbs ul li a {
display:table-cell;
vertical-align: middle;
float: left;
background: #009bda;
text-align: rigth;
padding: 15px 5px 15px 60px; /*changed*/
position: relative;
/* margin: 0px 0px 5px 0; */
font-family: Arial;
font-size: 16px;
text-decoration: none;
color: #fff;
height: 50px; /*added*/
}
#crumbs ul li a:after {
content:"";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid #009bda;
position: absolute;
right: -25px;
top: 0;
z-index: 1;
}
#crumbs ul li a:before {
content:'';
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid #fff;
position: absolute;
left: 0;
top: 0;
}
#crumbs ul li:first-child a {
border-top: 0px;
border-bottom: 0px;
}
#crumbs ul li:first-child a:before {
display: none;
}
#crumbs ul li:last-child a {
padding-right: 10px;
padding-bottom: 5px;
border-top-right-radius: 0px;
border-bottom: 0px;
}
#crumbs ul li:last-child a:after {
display: none;
}
#crumbs ul li a:hover {
background: #ed5338;
}
#crumbs ul li a:hover:after {
border-left-color: #ed5338;
}
<!-----------------------The non active state--------------------------> #crumbs ul li.notactive {
display: inline;
}
#crumbs ul li.notactive a {
display: block;
float: left;
background: #d1d1ce;
text-align: rigth;
padding: 25px 15px 0 60px;
position: relative;
margin: 0 0px 5px 0;
font-family: Arial;
font-size: 16px;
text-decoration: none;
color: #fff;
padding-right: 5px;
padding-bottom: 5px;
}
#crumbs ul li.notactive a:after {
content:"";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid #d1d1ce;
position: absolute;
right: -25px;
top: 0;
z-index: 1;
}
#crumbs ul li.notactive a:before {
content:"";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid transparent;
position: absolute;
left: 0;
top: 0;
}
#crumbs ul li.notactive:first-child a {
border-top: 0px;
border-bottom: 0px;
}
#crumbs ul li.notactive:first-child a:before {
display: none;
}
#crumbs ul li.notactive:last-child a {
padding-right: 10px;
padding-bottom: 5px;
border-top-right-radius: 0px;
border-bottom: 0px;
}
#crumbs ul li.notactive:last-child a:after {
display: none;
}
#crumbs ul li a:hover {
background: #ed5338;
}
#crumbs ul li a:hover:after {
border-left-color: #ed5338;
}
<!-------------------Blue box-------------------------> #crumbs ul li.blue {
display: inline;
}
#crumbs ul li.blue a {
display: block;
float: left;
background: #009bda;
text-align: rigth;
padding: 25px 15px 0 60px;
position: relative;
margin: 0 0px 5px 0;
font-family: Arial;
font-size: 16px;
text-decoration: none;
color: #fff;
padding-right: 5px;
padding-bottom: 5px;
}
<!-------------------Grey box-------------------------> #crumbs ul li.grey {
display: inline;
}
#crumbs ul li.grey a {
display: block;
float: left;
background: #d1d1ce;
text-align: rigth;
padding: 15px 15px 15px 60px; /*changed*/
position: relative;
font-family: Arial;
font-size: 16px;
text-decoration: none;
color: #fff;
padding-right: 5px;
padding-bottom: 5px;
height: 50px;
}
#crumbs ul li.grey a:after {
content:"";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid #d1d1ce;
position: absolute;
right: -25px;
top: 0;
z-index: 1;
}
#crumbs ul li.grey a:before {
content:"";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid transparent;
position: absolute;
left: 0;
top: 0;
}
<div id="crumbs">
<ul>
<li>Start
</li>
<li class="grey">About you
</li>
<li class="grey">Plans
</li>
<li class="grey">Details
</li>
<li class="grey">Enroll
</li>
</ul>
</div>
Or you can use flexbox like this:
* {
box-sizing: border-box;
}
#crumbs ul {
display: inline-table;
}
#crumbs ul li {
display:table-cell;
vertical-align: middle;
}
#crumbs ul li a {
display: flex;
align-items: center;
float: left;
background: #009bda;
text-align: rigth;
padding-left: 60px; /*changed*/
position: relative;
/* margin: 0px 0px 5px 0; */
font-family: Arial;
font-size: 16px;
text-decoration: none;
color: #fff;
padding-right: 5px;
/* padding-bottom: 5px; */
height: 50px;
}
#crumbs ul li a:after {
content:"";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid #009bda;
position: absolute;
right: -25px;
top: 0;
z-index: 1;
}
#crumbs ul li a:before {
content:'';
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid #fff;
position: absolute;
left: 0;
top: 0;
}
#crumbs ul li:first-child a {
border-top: 0px;
border-bottom: 0px;
}
#crumbs ul li:first-child a:before {
display: none;
}
#crumbs ul li:last-child a {
padding-right: 10px;
/*padding-bottom: 5px;*/
border-top-right-radius: 0px;
border-bottom: 0px;
}
#crumbs ul li:last-child a:after {
display: none;
}
#crumbs ul li a:hover {
background: #ed5338;
}
#crumbs ul li a:hover:after {
border-left-color: #ed5338;
}
<!-----------------------The non active state--------------------------> #crumbs ul li.notactive {
display: inline;
}
#crumbs ul li.notactive a {
display: block;
float: left;
background: #d1d1ce;
text-align: rigth;
padding: 25px 15px 0 60px;
position: relative;
margin: 0 0px 5px 0;
font-family: Arial;
font-size: 16px;
text-decoration: none;
color: #fff;
padding-right: 5px;
padding-bottom: 5px;
}
#crumbs ul li.notactive a:after {
content:"";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid #d1d1ce;
position: absolute;
right: -25px;
top: 0;
z-index: 1;
}
#crumbs ul li.notactive a:before {
content:"";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid transparent;
position: absolute;
left: 0;
top: 0;
}
#crumbs ul li.notactive:first-child a {
border-top: 0px;
border-bottom: 0px;
}
#crumbs ul li.notactive:first-child a:before {
display: none;
}
#crumbs ul li.notactive:last-child a {
padding-right: 10px;
padding-bottom: 5px;
border-top-right-radius: 0px;
border-bottom: 0px;
}
#crumbs ul li.notactive:last-child a:after {
display: none;
}
#crumbs ul li a:hover {
background: #ed5338;
}
#crumbs ul li a:hover:after {
border-left-color: #ed5338;
}
<!-------------------Blue box-------------------------> #crumbs ul li.blue {
display: inline;
}
#crumbs ul li.blue a {
display: block;
float: left;
background: #009bda;
text-align: rigth;
padding: 25px 15px 0 60px;
position: relative;
margin: 0 0px 5px 0;
font-family: Arial;
font-size: 16px;
text-decoration: none;
color: #fff;
padding-right: 5px;
padding-bottom: 5px;
}
<!-------------------Grey box-------------------------> #crumbs ul li.grey {
display: inline;
}
#crumbs ul li.grey a {
/* display: block; */
float: left;
background: #d1d1ce;
text-align: rigth;
padding-left: 60px;
position: relative;
/* margin: 0 0px 5px 0; */
font-family: Arial;
font-size: 16px;
text-decoration: none;
color: #fff;
padding-right: 5px;
/* padding-bottom: 5px; */
}
#crumbs ul li.grey a:after {
content:"";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid #d1d1ce;
position: absolute;
right: -25px;
top: 0;
z-index: 1;
}
#crumbs ul li.grey a:before {
content:"";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid transparent;
position: absolute;
left: 0;
top: 0;
}
<div id="crumbs">
<ul>
<li>Start
</li>
<li class="grey">About you
</li>
<li class="grey">Plans
</li>
<li class="grey">Details
</li>
<li class="grey">Enroll
</li>
</ul>
</div>
In both case I commented the changed code.