juanperosa
08-13-2015, 04:03 PM
Hi there,
I was practising my CSS coding skills ( i am still a noob xD ) and tried to create my own breadcrumbs styles for my website, but i am missing something about sizes.
5708
My problem is that each crumb gets the size of the original title of the page, instead of following the one i wrote on the code, and that's the problem i don't understand.
I will attach the CSS used on it (ignore colors, still working on it), so you can tell me wether or not there's a mistake on it.
Thanks in advance for your help.
.breadcrumbs {
overflow: hidden;
font: 16px Helvetica, Arial, Sans-Serif;
margin-bottom: 20px;
}
.breadcrumbs a {
color: white;
text-decoration: none;
padding: 5px 0 5px 55px;
background: cyan;
background: hsla(250, 100%, 52%, 1);
position: relative;
display: block;
float: left;
}
.breadcrumbs a:after {
content: " ";
display: block;
width: 0;
height: 0;
border-top: 50px solid transparent;
border-bottom: 50px solid transparent;
border-left: 30px solid hsla(250, 100%, 52%, 1);
position: absolute;
top: 50%;
margin-top: -50px;
left: 100%;
z-index: 2;
}
.breadcrumbs 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;
}
.breadcrumbs a:first-child {
padding-left: 10px;
}
.breadcrumbs a:nth-child(2) { background: hsla(250, 100%, 52%, 1) }
.breadcrumbs a:nth-child(2):after { border-left-color: hsla(34,85%,45%,1); }
.breadcrumbs a:nth-child(3) { background: hsla(34,85%,55%,1); }
.breadcrumbs a:nth-child(3):after { border-left-color: hsla(34,85%,55%,1); }
.breadcrumbs a:nth-child(4) { background: hsla(34,85%,65%,1); }
.breadcrumbs a:nth-child(4):after { border-left-color: hsla(34,85%,65%,1); }
.breadcrumbs a:nth-child(5) { background: hsla(34,85%,75%,1); }
.breadcrumbs a:nth-child(5):after { border-left-color: hsla(34,85%,75%,1); }
.breadcrumbs a:last-child a {
background: white !important;
color: black;
pointer-events: none;
cursor: default;
}
.breadcrumbs a:hover { background: hsla(34,85%,25%,1); }
.breadcrumbs a:hover:after { border-left-color: hsla(34,85%,25%,1) !important; }
I was practising my CSS coding skills ( i am still a noob xD ) and tried to create my own breadcrumbs styles for my website, but i am missing something about sizes.
5708
My problem is that each crumb gets the size of the original title of the page, instead of following the one i wrote on the code, and that's the problem i don't understand.
I will attach the CSS used on it (ignore colors, still working on it), so you can tell me wether or not there's a mistake on it.
Thanks in advance for your help.
.breadcrumbs {
overflow: hidden;
font: 16px Helvetica, Arial, Sans-Serif;
margin-bottom: 20px;
}
.breadcrumbs a {
color: white;
text-decoration: none;
padding: 5px 0 5px 55px;
background: cyan;
background: hsla(250, 100%, 52%, 1);
position: relative;
display: block;
float: left;
}
.breadcrumbs a:after {
content: " ";
display: block;
width: 0;
height: 0;
border-top: 50px solid transparent;
border-bottom: 50px solid transparent;
border-left: 30px solid hsla(250, 100%, 52%, 1);
position: absolute;
top: 50%;
margin-top: -50px;
left: 100%;
z-index: 2;
}
.breadcrumbs 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;
}
.breadcrumbs a:first-child {
padding-left: 10px;
}
.breadcrumbs a:nth-child(2) { background: hsla(250, 100%, 52%, 1) }
.breadcrumbs a:nth-child(2):after { border-left-color: hsla(34,85%,45%,1); }
.breadcrumbs a:nth-child(3) { background: hsla(34,85%,55%,1); }
.breadcrumbs a:nth-child(3):after { border-left-color: hsla(34,85%,55%,1); }
.breadcrumbs a:nth-child(4) { background: hsla(34,85%,65%,1); }
.breadcrumbs a:nth-child(4):after { border-left-color: hsla(34,85%,65%,1); }
.breadcrumbs a:nth-child(5) { background: hsla(34,85%,75%,1); }
.breadcrumbs a:nth-child(5):after { border-left-color: hsla(34,85%,75%,1); }
.breadcrumbs a:last-child a {
background: white !important;
color: black;
pointer-events: none;
cursor: default;
}
.breadcrumbs a:hover { background: hsla(34,85%,25%,1); }
.breadcrumbs a:hover:after { border-left-color: hsla(34,85%,25%,1) !important; }