Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a Button with right triangle/pointer

Tags:

css

css-shapes

Looking to create this: button with right arrow/pointer

What would be the best way to achieve it?

IT MUST: I'd definitely like to keep the text as text (so not using an image). Also, I'd like this to be re-usable so that I can put different text in it. Ideally, the arrow part should be as high as the text.

NICE TO HAVE: I'd like to be able to drop this on any background (so it isn't always on white) Would be great if it was ie8+

Thanks!!

like image 216
user1010892 Avatar asked Aug 22 '12 11:08

user1010892


1 Answers

Have you tried something using html/css??

#vert_menu{   overflow: hidden;  width: 100%; }
#vert_menu li{  float: left; }
#vert_menu a{
  padding: 8px 20px 8px 40px;
  float: left; text-align:center;
  text-decoration: none; font: normal 16px Myriad Pro, Helvetica, Arial, sans-serif;  text-shadow:0px 1px 0px #000;
  color: #e6e2cf;
  position: relative; text-shadow:1px 0 0 #000;
  background: #525252;  min-width:181px; width:auto
}

#vert_menu a::after,
#vert_menu a::before{
  content: "";
  position: absolute;
  top: 50%;
  margin-top: -19px;   
  border-top: 19px solid transparent;
  border-bottom: 19px solid transparent;
  border-left: 1em solid;
  right: -1em;
}
#vert_menu a::after{   z-index: 2;  border-left-color: #525252;   }
<ul id="vert_menu">
<li><a href="#" class="current">test</a></li>
</ul>
like image 141
Sowmya Avatar answered Nov 15 '22 09:11

Sowmya