Desired Behaviour
I want to make this shape in CSS - it's a tab for a menu item.
The implementation scenario is an HTML template where CSS style sheets are switched to make color changes etc.
I want to use CSS to style the tab rather than background images so that I don't have to create a specific background image for each theme's version of a menu item tab.
What I've Tried
I looked around at some CSS shape sites and tried to pull them apart and adjust border widths etc, but haven't been able to get the desired result yet. Below are a few attempts.
.my_tab:before {
content: "";
position: absolute;
height: 0;
width: 0;
top: -45px;
left: 0px;
border-width: 0 105px 25px 0;
border-style: solid;
border-color: transparent transparent blue;
}
.my_tab {
position: relative;
width: 104px;
border-width: 20px 0 0 0;
border-style: solid;
border-color: red transparent;
top: 50px;
}
.my_tab_two {
background: purple none repeat scroll 0 0;
height: 22px;
position: relative;
top: 150px;
width: 104px;
}
.my_tab_two a {
color: white;
display: block;
font-family: arial;
margin: 0 auto;
text-align: center;
text-decoration: none;
width: 40px !important;
}
.my_tab_three {
background: green none repeat scroll 0 0;
border-radius: 0 5px 0 0;
height: 15px;
position: relative;
top: 113px;
width: 104px;
}
/* -------- */
p {
font-family: arial;
}
.para_two {
margin-top: 105px;
position: absolute;
}
<p>attempt 01:</p>
<div class="my_tab"></div>
<p class="para_two">attempt 02:</p>
<div class="my_tab_two"><a href="#">link</a>
</div>
<div class="my_tab_three"></div>
<div class="my_tab_four"></div>
JSFiddle

