Horizontally align <li>'s of varying line numbers - html

I've borrowed and modified this code from jsfiddle to the code snippet below. I want to be able to wrap text in some arrows and not in others. As you can see, a single line of text doesn't render in the same place and two lines. I want the text centered in the <li>, How do I fix?
ul.money-class {
/*margin: 20px 60px;*/
margin-bottom: 0px
}
ul.money-class li {
display: inline-block;
height: 60px;
line-height: 60px;
width: 150px;
margin: 5px 1px 0 0;
text-indent: 35px;
position: relative;
}
ul.money-class li:before {
content: " ";
height: 0;
width: 0;
position: absolute;
left: 0px;
border-style: solid;
border-width: 30px 0 30px 30px;
border-color: transparent transparent transparent #fff;
z-index: 0;
}
ul.money-class li:first-child:before {
/*border-color: transparent;*/
}
ul.money-class li a:after {
content: " ";
height: 0;
width: 0;
position: absolute;
right: -30px;
top: 0px;
border-style: solid;
border-width: 30px 0 30px 30px;
border-color: transparent transparent transparent #ccc;
z-index: 10;
text-decoration: none;
}
ul.money-class li.active a {
background: orange;
z-index: 100;
}
ul.money-class li.active a:after {
border-left-color: orange;
}
ul.money-class li a {
display: block;
background: #ccc;
}
ul.money-class li a:hover {
background: pink;
}
ul.money-class li a:hover:after {
border-color: transparent transparent transparent pink;
}
span {display: block; line-height: 30px;}
<table class="table">
<tr>
<td>
<ul class="money-class">
<li class="active"><span>Round 1</span><span>£100</span></li>
<li><span>Round 2</span><span>£200</span></li>
<li><span>Round 3</span><span>£300</span></li>
<li><span>Round 4</span><span>£400</span></li>
<li><span>Round 5</span><span>£500</span></li>
<li>Prize Pot</li>
</ul>
</td>
</tr>
</table>

You can add some inline style only for that line as in my comment
<li style="vertical-align:top"><span style="line-height:60px; height:60px">Prize Pot</span></li>
or
it could work by adding some css exception to the last li and its descendants, but it won't work if the single line is in a random position in the list...
ul.money-class {
/*margin: 20px 60px;*/
margin-bottom: 0px
}
ul.money-class li {
display: inline-block;
height: 60px;
line-height: 60px;
width: 150px;
margin: 5px 1px 0 0;
text-indent: 35px;
position: relative;
}
ul.money-class li:before {
content: " ";
height: 0;
width: 0;
position: absolute;
left: 0px;
border-style: solid;
border-width: 30px 0 30px 30px;
border-color: transparent transparent transparent #fff;
z-index: 0;
}
ul.money-class li:first-child:before {
/*border-color: transparent;*/
}
ul.money-class li a:after {
content: " ";
height: 0;
width: 0;
position: absolute;
right: -30px;
top: 0px;
border-style: solid;
border-width: 30px 0 30px 30px;
border-color: transparent transparent transparent #ccc;
z-index: 10;
text-decoration: none;
}
ul.money-class li.active a {
background: orange;
z-index: 100;
}
ul.money-class li.active a:after {
border-left-color: orange;
}
ul.money-class li:last-child {vertical-align:top}
ul.money-class li:last-child a span {line-height:60px}
ul.money-class li a {
display: block;
background: #ccc;
}
ul.money-class li a:hover {
background: pink;
}
ul.money-class li a:hover:after {
border-color: transparent transparent transparent pink;
}
span {display: block; line-height: 30px;}
<table class="table">
<tr>
<td>
<ul class="money-class">
<li class="active"><span>Round 1</span><span>£100</span></li>
<li><span>Round 2</span><span>£200</span></li>
<li><span>Round 3</span><span>£300</span></li>
<li><span>Round 4</span><span>£400</span></li>
<li><span>Round 5</span><span>£500</span></li>
<li>Prize Pot</li>
</ul>
</td>
</tr>
</table>

#UncaughtTypeError provided the right solution
Declare vertical-align: top on ul.money-class li

Related

CSS process flow arrows - bad formatting?

I modified 3 different peoples code to make css arrows and I think I made it more complicated than it needs to be. Any CSS expert than can help me clean this up?
I can't seem to modify padding and other attributes to get this where I want it within the divs.
css
<style>
/* These are the Stage Arrows - styles */
#testStatus {
position: relative;
width: auto;
height: 30px;
left: 10px;
}
.testStatus li {
position: relative;
text-indent: 10px;
height: 30px;
display: inline-block;
zoom: 1;
margin-left: -3px;
padding: 10px 10px 10px 10px;
color: white;
font-size: 12px;
text-align: center;
line-height: auto;
}
ul.testStatus {
list-style: none;
}
li.testStatus:first-child:after, li.testStatusGood:after, li.testStatusNoGood:after {
content: "";
position: absolute;
width: 0;
height: 0;
border-top: 15px solid transparent;
border-left: 10px solid #767676;
border-bottom: 15px solid transparent;
margin: -10px 0px 0px 10px;
z-index: 3;
}
li.testStatus:last-child:before, li.testStatusGood:before, li.testStatusNoGood:before {
content: "";
position: absolute;
width: 0;
height: 0;
left: 0;
border-top: 15px solid transparent;
border-left: 10px solid #EEEEEE;
border-bottom: 15px solid transparent;
margin: -10px 0px 0px 0px;
z-index: 2;
}
li.testStatus:first-child {
padding-left: 10px;
margin-left: 0;
background-color: #767676;
}
li.testStatus:last-child {
padding-right: 10px;
background-color: #767676;
}
li.testStatusGood {
background-color: #77a942;
}
li.testStatusGood:after {
border-left: 10px solid #77a942;
}
li.testStatusNoGood {
background-color: #c42c00;
}
li.testStatusNoGood:after {
border-left: 10px solid #c42c00;
}
/* End arrow formatting */
</style>
html
<ul>
<li>
<div id="testStatus">
<ul class="testStatus">
<li class="testStatus">Step 1</li>
<li class="testStatusGood">Step 2</li>
<li class="testStatusNoGood">Step 3</li>
<li class="testStatusNoGood">Step 4</li>
<li class="testStatus">Step 5</li>
</ul>
</div>
</li>
</ul>
My arrows display nicely but I am having difficulty adjusting the padding to 0. I've tried the #, the ul class, the il class and I am a bit baffled why I cannot remove the 10px (I believe its the padding).
There is also a faintly darker border on the left side of the triangular portion of the arrows, if you look closely, that I'd like to have match the color exactly.
Duo's code output above image, Ojer code output below image
I'm going backwards :)
Here you go:
.breadcrumbs {
border: 1px solid #cbd2d9;
border-radius: 0.3rem;
display: inline-flex;
overflow: hidden;
}
.breadcrumbs__item {
background: #fff;
color: #333;
outline: none;
padding: 0.75em 0.75em 0.75em 1.25em;
position: relative;
text-decoration: none;
transition: background 0.2s linear;
}
.breadcrumbs__item:hover:after,
.breadcrumbs__item:hover {
background: #edf1f5;
}
.breadcrumbs__item:focus:after,
.breadcrumbs__item:focus,
.breadcrumbs__item.is-active:focus {
background: #323f4a;
color: #fff;
}
.breadcrumbs__item:after,
.breadcrumbs__item:before {
background: white;
bottom: 0;
clip-path: polygon(50% 50%, -50% -50%, 0 100%);
content: "";
left: 100%;
position: absolute;
top: 0;
transition: background 0.2s linear;
width: 1em;
z-index: 1;
}
.breadcrumbs__item:before {
background: #cbd2d9;
margin-left: 1px;
}
.breadcrumbs__item:last-child {
border-right: none;
}
.breadcrumbs__item.is-active {
background: #edf1f5;
}
/* Some styles to make the page look a little nicer */
body {
color: #323f4a;
background: #f5f7fa;
display: flex;
align-items: center;
justify-content: center;
}
html, body {
height: 100%;
}
.gray{
background-color:gray;
}
.breadcrumbs__item.gray:after{
background-color:gray;
}
.red{
background-color:red;
}
.breadcrumbs__item.red:after{
background-color:red;
}
.green{
background-color:green;
}
.breadcrumbs__item.green:after{
background-color:green;
}
<li class="breadcrumbs">
Prospect
Opportunity
Accound
Sales
Support
</li>
This can work for you.
Check this Pen
HTML:
<ul class="steps">
<li class="past">
<span>
<strong>Step 1</strong>
</span><i></i>
</li>
<li class="present">
<span>
<strong>Step 2</strong>
</span><i></i>
</li>
<li class="future">
<span>
<strong>Step 3</strong>
</span><i></i>
</li>
<li class="future1">
<span>
<strong>Step 4</strong>
</span><i></i>
</li>
<li class="present1">
<span>
<strong>Step 5</strong>
</span><i></i>
</li>
</ul>
CSS:
.steps {
padding-left: 0;
list-style: none;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 12px;
line-height: 1;
margin: 30px auto;
border-radius: 3px;
}
.steps strong {
font-size: 14px;
display: block;
line-height: 2.1;
}
.steps > li {
position: relative;
display: block;
/* border: 1px solid #ddd; */
padding: 12px 50px 8px 50px;
width: 140px;
height: 40px;
}
#media (min-width: 768px) {
.steps > li {
float: left;
}
.steps .past {
color: #fff;
background: blue;
}
.steps .present {
color: #000;
background: yellow;
}
.steps .future {
color: #fff;
background: green;
}
.steps .present1 {
color: #000;
background: red;
}
.steps .future1 {
color: #fff;
background: purple;
}
.steps .present1 {
color: #fff;
}
.steps li > span:after,
.steps li > span:before {
content: "";
display: block;
width: 0px;
height: 0px;
position: absolute;
top: 0;
left: 0;
border: solid transparent;
border-left-color: #f0f0f0;
border-width: 30px;
}
.steps li > span:after {
top: -4px;
z-index: 1;
border-left-color: white;
border-width: 34px;
}
.steps li > span:before {
z-index: 2;
}
.steps li.past + li > span:before {
border-left-color: blue;
}
.steps li.present + li > span:before {
border-left-color: yellow;
}
.steps li.future + li > span:before {
border-left-color: green;
}
.steps li.future1 + li > span:before {
border-left-color: purple;
}
.steps li:first-child > span:after,
.steps li:first-child > span:before {
display: none;
}
/* Arrows at start and end */
.steps li:first-child i,
.steps li:last-child i {
display: block;
position: absolute;
top: 0;
left: 0;
border: solid transparent;
border-left-color: white;
border-width: 30px;
}
.steps li:last-child i {
left: auto;
right: -30px;
border-left-color: transparent;
border-top-color: white;
border-bottom-color: white;
}
}

Chevron buttons

I'm looking to achieve this with CSS:
and this is what I've got:
.breadcrumb {
list-style: none;
overflow: hidden;
font: 18px Helvetica, Arial, Sans-Serif;
margin: 0;
padding: 0;
}
.breadcrumb li {
float: left;
}
.breadcrumb li a {
border: 1px solid #c00;
color: black;
text-decoration: none;
padding: 10px 0 10px 55px;
background: #fff;
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 #fff;
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;
/* Go big on the size, and let overflow hide */
border-bottom: 50px solid transparent;
border-left: 30px solid red;
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 a:hover {
background: hsla(34, 85%, 25%, 1);
}
.breadcrumb li a:hover:after {
border-left-color: hsla(34, 85%, 25%, 1) !important;
}
.breadcrumb li:last-child a {
border-right: 1px solid red;
}
.breadcrumb li:last-child a:before {
border-left: 0 solid transparent;
}
<ul class="breadcrumb">
<li>Home</li>
<li>Vehicles</li>
</ul>
Issues:
Can't get the right side borders to show correctly
Can't get the right border of last element to be normal (not a chevron)
Can't get hover state right because of right side borders.
Here's is my working jsFiddle
.breadcrumb {
list-style: none;
overflow: hidden;
font: 18px Helvetica, Arial, Sans-Serif;
margin: 0;
padding: 0;
}
.breadcrumb li {
float: left;
position: relative;
background: #fff;
margin: 0 5px;
}
.breadcrumb li a {
border: 1px solid #0976a1;
color: #0976a1;
text-decoration: none;
padding: 10px 10px 10px 32px;
position: relative;
display: block;
z-index: 99;
font-weight: bold;
}
.breadcrumb li:first-child a {
padding-left: 10px;
border-right: none;
}
.breadcrumb li:last-child a {
border-left: none;
}
.breadcrumb li:before, .breadcrumb li:after{
content: " ";
display: block;
width: 33px;
height: 29px;
border-top: 5px solid transparent;
border-bottom: 1px solid #0976a1;
border-right: 1px solid #0976a1;
position: absolute;
top: 4px;
z-index: -1;
background: #fff;
transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
}
.breadcrumb li:before {
left: 87%;
}
.breadcrumb li:after {
left: 81%;
}
.breadcrumb li:first-child:before, .breadcrumb li:first-child:after{ z-index: 1; }
.breadcrumb li:first-child:after{ left: 73%; }
.breadcrumb li:last-child:before, .breadcrumb li:last-child:after{
display: none;
}
.breadcrumb li:first-child:hover:after, .breadcrumb li:hover{ background: #0976a1; }
.breadcrumb li:hover a{ border-color: transparent; }
.breadcrumb li:hover a{ color: #fff; }
<ul class="breadcrumb">
<li>Home</li>
<li>Vehicles</li>
</ul>
I hope this will help you :)
I think this code is helpful.
.breadcrumb {
list-style: none;
overflow: hidden;
font: 18px Helvetica, Arial, Sans-Serif;
margin: 0;
padding: 0;
}
.breadcrumb li {
float: left;
margin-right: 10px;
}
.breadcrumb li:first-child {
z-index: 9;
position:relative;
}
.breadcrumb li a {
border: 1px solid #006A9C;
color: black;
text-decoration: none;
padding: 10px 10px 10px 10px;
background: #fff;
position: relative;
display: block;
float: left;
}
.breadcrumb li:first-child a:after {
border-color:#fff;
border-style: solid;
border-width: 15px;
bottom: -30px;
box-shadow: 0 0 0 0 #c00, -1px 1px 0 1px #006A9C;
content: "";
height: 0;
position: absolute;
right: -29px;
transform: rotate(-135deg);
transform-origin: 0 0 0;
width: 0;
z-index: -1;
}
.breadcrumb li:first-child a {
border-right: 0;
}
.breadcrumb li:last-child a {
border-left: 0;
}
.breadcrumb li:last-child a:after{
display:none;
}
.breadcrumb li:last-child a:before{
border-color:#fff;
border-style: solid;
border-width: 15px;
bottom: -30px;
box-shadow: 0 0 0 0 #006A9C, -1px 1px 0 1px #006A9C;
content: "";
height: 0;
position: absolute;
left: -1px;
transform: rotate(-135deg);
transform-origin: 0 0 0;
width: 0;
}
.breadcrumb li:last-child a {
padding-left: 28px;
}
.breadcrumb li a:hover {
background: #006A9C;
color: #fff;
}
.breadcrumb li a:first-child:hover::after {
border-color:#006A9C;
}
<ul class="breadcrumb">
<li>Home</li>
<li>Vehicles</li>
</ul>
*{
margin: 0;
padding: 0;
}
.container{
margin: 20px;
display: flex;
flex-direction: row;
border: 1px solid skyblue;
width: 200px;
overflow: hidden;
}
.left,.right{
display: inline-block;
//border: 1px solid black;
line-height: 50px;
width: 100px;
height: 100%;
position: relative;
}
.right{
text-align: center;
}
p:hover{
background-color: skyblue;
color: white;
}
.left::after{
content:'';
position: absolute;
left: 70px;
top: 3px;
display: inline-block;
width: 45px;
height: 45px;
z-index: 2;
background:white;
transform:rotate(-45deg);
border-right: 1px solid skyblue;
border-bottom: 1px solid skyblue;
}
.left:hover::after{
background-color: skyblue;
}
<div class="container">
<p class="left">LEFT</p>
<p class="right">RIGHT</p>
</div>
It is doing my best.
I hope it will be useful for you.

Breadcrump with css

In this fiddle I create a simple breadcrumb. I like to change the dependencies of class "div.arrow-right". I like to control the arrow size by "#sequence". So that the size of the arrow belongs to the font-size. That means if I change the font-size the right-arrow should fit automatically the same high as the div which contains the writing.
#sequence {
font-size: 28px;
}
And I like to add a gap or lets say a white thin arrow between two breadcrumb elements, see the picture below.
An alternate using :before and :after pseudo elements. Fiddle
.breadcrumb {
list-style: none;
overflow: hidden;
font-size: 28px;
}
.breadcrumb li {
color: white;
text-decoration: none;
padding: 8px 0 8px 50px;
position: relative;
display: block;
float: left;
cursor: pointer;
}
.breadcrumb li:after {
content: "";
display: block;
width: 0;
height: 0;
border-top: 50px solid transparent;
border-bottom: 50px solid transparent;
border-left: 30px solid #74c476;
position: absolute;
top: 50%;
margin-top: -50px;
left: 100%;
z-index: 2;
}
.breadcrumb li: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: 2px;
left: 100%;
z-index: 1;
}
li:nth-child(1) {
padding-left: 20px;
background-color: #74c476;
}
li:nth-child(2) {
background-color: #61a362;
}
li:nth-child(3) {
background-color: #518851;
}
li:nth-child(1):after {
border-left-color: #74c476;
}
li:nth-child(2):after {
border-left-color: #61a362;
}
li:nth-child(3):after {
border-left-color: #518851;
}
<ul class="breadcrumb">
<li>hello</li>
<li>operator</li>
<li>layout</li>
</ul>

Can you create a css "function" or wrapper

So got a bit of a problem, and trying to figure out the best way.
So got some css code (heavily borrowed from coders better than me) that creates a pretty set of arrows in a menu, heavily using :after and :hover and all sorts. Had to write it in another application and now want to move it to the actual page.
Problem is, I need to set the class, and I am doing something really wrong. Basically, I decided to use the class "arrowrt" to set this to the top menu. But what is the easiest way to wrap it, or is it even easy to wrap it. Wanted to do something like .arrowrt { Loads of CSS settings }.
The code currently looks as follows
<style type="text/css" media="all">
a {
text-decoration:none;
}
ul {
margin: 20px 60px;
}
li {
margin-right: 5px;
}
ul li {
display: inline-block;
font-size: 12px;
height: 30px;
line-height: 30px;
width: 150px;
margin: 5px 8px 0 0;
text-align: center;
position: relative;
}
ul li:before {
content: " ";
height: 0;
width: 0;
position: absolute;
left: -2px;
border-style: solid;
border-width: 15px 0 15px 15px;
border-color: transparent transparent transparent #fff;
z-index: 0;
}
ul li:first-child:before , .dbfsrt {
border-color: transparent;
}
ul li a:after {
content: " ";
height: 0;
width: 0;
position: absolute;
right: -15px;
border-style: solid;
color: #000000;
border-width: 15px 0 15px 15px;
border-color: transparent transparent transparent #ccc;
z-index: 10;
}
ul li.arractive a {
background: orange;
z-index: 100;
}
ul li.active a:after {
border-left-color: orange;
}
ul li a {
display: block;
background: #ccc;
color: #000000;
}
ul li a:hover {
background: #000000;
color: #ececec;
}
ul li a:hover:after {
border-color: transparent transparent transparent #000000;
}
</style>
And the HTML section
<ul id="arrowrt">
<li class="arrowrt">Home</li>
<li class="arrowrt">Back Office</li>
<li class="arrowrt">Cash Management</li>
<li class="arrowrt arractive">Overdraft Management</li>
</ul>
You could (if using sass) do something like this:
.arrowrt li {
display: inline-block;
font-size: 12px;
height: 30px;
line-height: 30px;
width: 150px;
margin: 5px 8px 0 0;
text-align: center;
position: relative;
&:before {
content: " ";
height: 0;
width: 0;
position: absolute;
left: -2px;
border-style: solid;
border-width: 15px 0 15px 15px;
border-color: transparent transparent transparent #fff;
z-index: 0;
}
&:first-child:before {
border-color: transparent;
}
}
.dbfsrt {
border-color: transparent;
}
.arrowrt li {
a:after {
content: " ";
height: 0;
width: 0;
position: absolute;
right: -15px;
border-style: solid;
color: #000000;
border-width: 15px 0 15px 15px;
border-color: transparent transparent transparent #ccc;
z-index: 10;
}
&.arractive a {
background: orange;
z-index: 100;
}
&.active a:after {
border-left-color: orange;
}
a {
display: block;
background: #ccc;
color: #000000;
&:hover {
background: #000000;
color: #ececec;
&:after {
border-color: transparent transparent transparent #000000;
}
}
}
}
but you should have arrowrt as a class not id so that it can be reused.
The css equiv of this would be:
.arrowrt li {
display: inline-block;
font-size: 12px;
height: 30px;
line-height: 30px;
width: 150px;
margin: 5px 8px 0 0;
text-align: center;
position: relative;
}
.arrowrt li:before {
content: " ";
height: 0;
width: 0;
position: absolute;
left: -2px;
border-style: solid;
border-width: 15px 0 15px 15px;
border-color: transparent transparent transparent #fff;
z-index: 0;
}
.arrowrt li:first-child:before {
border-color: transparent;
}
.dbfsrt {
border-color: transparent;
}
.arrowrt li a:after {
content: " ";
height: 0;
width: 0;
position: absolute;
right: -15px;
border-style: solid;
color: #000000;
border-width: 15px 0 15px 15px;
border-color: transparent transparent transparent #ccc;
z-index: 10;
}
.arrowrt li.arractive a {
background: orange;
z-index: 100;
}
.arrowrt li.active a:after {
border-left-color: orange;
}
.arrowrt li a {
display: block;
background: #ccc;
color: #000000;
}
.arrowrt li a:hover {
background: #000000;
color: #ececec;
}
.arrowrt li a:hover:after {
border-color: transparent transparent transparent #000000;
}

Show a triangle below selected menu item

I'd like to show a little triangle (similar as my tag box) below the selected menu item. I've tried various things without success, see http://jsfiddle.net/7zRVU/1/
How could I do that? Many thanks
nav {
float: right;
margin: 20px auto;
width: 100%;
}
nav ul {
margin-right: -4px;
margin-left: 5px;
text-align: right;
}
nav ul li {
display: inline-block;
margin-right: -4px;
margin-left: 5px;
vertical-align: top;
}
nav a {
padding: 4px 8px;
text-decoration: none;
color: rgba(255,255,255,1) !important ;
background: rgba(0,0,0,0.25);
font-weight: 300;
text-transform: uppercase;
letter-spacing: 1.5px;
font-size: 14px;
font-weight: 400;
}
nav a:hover {
background: rgba(0,0,0,0.35) !important ;
}
.activeNav {
background: rgba(0,0,0,0.35) !important ;
}
nav ul li ul {
position: absolute;
display: block;
margin-top: 5px;
background: none;
padding-top: 5px
}
nav ul li ul li {
display: block;
float: none;
margin: 0;
padding: 0
}
nav ul li ul li a {
display: block;
text-align: left;
color: rgba(255,255,255,0.9) !important ;
text-shadow: 0 1px rgba(0,0,0,0.33) !important ;
padding: 10px
}
nav ul li ul li a:hover {
background: rgba(20,150,220,0.5) !important ;
color: white;
text-shadow: 0 1px rgba(0,0,0,0.5)
}
.hover a {
display: block;
}
.hover span {
color: rgba(255,255,255,0.9);
background: rgba(20,150,220,0.5);
border-radius: 5px;
position: absolute;
display: block;
margin: 5px 0 0 -57px;
padding: 10px;
font-size: 13px;
font-weight: 300;
letter-spacing: 1.5px;
text-transform: uppercase;
text-align: center;
cursor: default;
}
li.selected a{
border-bottom: 1px solid rgba(16,65,145,0.9);
}
li.selected a:after {
top: 100%;
left: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
border-color: rgba(136, 183, 213, 0);
border-top-color: #3A7CDB;
border-width: 10px;
margin-left: -10px;
}
.tagbox {
top: -10px;
left: 60%;
position: absolute;
background-color: #3A7CDB;
background-image: linear-gradient(to bottom, #518CDE, #3A7CDB);
background-repeat: repeat-x;
padding: 10px 20px;
width: 250px;
margin-left: 0px;
text-align: center;
color: #fff;
margin-top:140px;
}
.tagbox:after {
top: 100%;
left: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
border-color: rgba(136, 183, 213, 0);
border-top-color: #3A7CDB;
border-width: 10px;
margin-left: -10px;
}
Here's an update to your fiddle - http://jsfiddle.net/7zRVU/4/1
You have actually done it, but you just need a "position:relative;" to your "selected" class, so the arrow to be absolutely positioned with it, and then, just change the position of the arrow to "top: height of the selected item"
.selected {
position: relative;
}
li.selected a:after {
top: 23px;
left: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
border-color: rgba(136, 183, 213, 0);
border-top-color: #3A7CDB;
border-width: 10px;
margin-left: -10px;
}