Search code examples
cssshapesalignment

Coding a shape with CSS


I've created a shape purely by CSS. The following link includes my work.

http://jsfiddle.net/kaHek/119/

CSS:

#applicationStatus {
position: relative;
width: 630px;
height: 140px;
top: 20px;
left: 40px; }

ul.applicationStatus {
list-style: none; }

li.applicationStatus, li.applicationStatusGood, li.applicationStatusNoGood {
height: 140px;
background-color: #767676;
display: inline-block;
/* Dirty IE Hack */
zoom: 1;
*display: inline;
margin-right: 30px;
padding: 10px;
color: white;
font-size: 18px;
text-align: center;
line-height: 150px;
/*      vertical-align: middle; */ }
li.applicationStatus:after, li.applicationStatusGood:after, li.applicationStatusNoGood:after {
content: "";
position: absolute;
width: 0;
height: 0;
border-top: 80px solid transparent;
border-left: 30px solid #77a942;
border-bottom: 80px solid transparent;
margin: -10px 90px 0 0px; }

HTML

<div id="applicationStatus">
    <ul>
        <li class="applicationStatus">Başvuru Alındı</li>
        <li class="applicationStatusGood">Dil Sınavı</li>
        <li class="applicationStatusNoGood">Sözlü Mülakat</li>
        <li class="applicationStatus">Hibe</li>
    </ul>
</div>

What I'm trying to achieve is the following:

enter image description here

I'm struggling with aligning the arrow part of the image. I created that part with :after pseudo-element with the help of css3shapes.com but I can't seem to align it properly.

Setting the margin value of the after selector works for vertical positioning but not for horizontal positioning.

What should I do?


Solution

  • Check the Jsfiddle

    http://jsfiddle.net/arunberti/kaHek/120/

    margin: -10px 90px 0 10px;