Cupid
Cupid

Reputation: 48

CSS styling issue on un-ordered list

I am trying to come up with a tab control and included in here is the link to jsfiddle and what I am trying to accomplish. The issue I have in here is to eliminate the curve at the end of the unordered list after Alpha. I tried it in a lot of different ways. It looks like the next tab has been cut off.

http://jsfiddle.net/v7u3xsxk/

CSS & The Tab.

<ul class="tabrow">
    <li id="a" class="current"><a href="#tab1">Adam</a></li>
    <li id="b"><a href="#tab2">Andrew</a></li>
    <li id="c"><a href="#tab3">Alpha</a></li>
</ul>

.tabrow {
    list-style: none;
    margin: 50px 0 0px;
    padding: 0;
    line-height: 35px;
    height: 37px;
    overflow: hidden;   
    font-family: Arial,Helvetica, sans-serif;
    /*position: relative;*/
    width:auto;
}

.tabrow li {
    border: 1px solid #AAA;
    background: #D1D1D1;
    background: -o-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
    background: -ms-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
    background: -moz-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
    background: -webkit-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
    background: linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
    display: inline-block;
    position: relative;
    z-index: 0;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), inset 0 1px 0 #FFF;
    text-shadow: 0 1px #FFF;
    margin: 0 -5px;
    padding: 0 30px;
    height: 37px;
    line-height: 37px;

}

.tabrow a {
    color: #555;
    text-decoration: none;
}

.tabrow li.current {
    background: #FFF;
    color: #333;
    z-index: 2;
    border-top-color: #FFF;
}

.tabrow:before {
    position: absolute;
    content: " ";
    width: 100%;
    top: 0;
    left: 0;
    border-top: 1px solid #AAA;
    z-index: 1;
}

.tabrow li:before,
.tabrow li:after {
    border: 1px solid #AAA;
    position: absolute;
    top: -1px;
    width: 6px;
    height: 6px;
    content: " ";
}

.tabrow li:before {
    left: -7px;
    border-top-right-radius: 6px;
    border-width: 1px 1px 0px 0px;
    box-shadow: 2px 0px 0 #ECECEC;
}

.tabrow li:after {
    right: -7px;
    border-top-left-radius: 6px;
    border-width: 1px 0px 0px 1px;
    box-shadow: -2px 0px 0 #ECECEC;
}

.tabrow li.current:before {
    box-shadow: 2px 0px 0 #FFF;
}

.tabrow li.current:after {
    box-shadow: -2px 0px 0 #FFF;
}

Upvotes: 0

Views: 54

Answers (2)

Celt
Celt

Reputation: 2548

If you remove position: relative; from your .tabrow li class it will solve the problem.

Updated code:

.tabrow li {
    border: 1px solid #AAA;
    background: #D1D1D1;
    background: -o-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
    background: -ms-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
    background: -moz-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
    background: -webkit-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
    background: linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
    display: inline-block;
      //removed line here
    z-index: 0;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), inset 0 1px 0 #FFF;
    text-shadow: 0 1px #FFF;
    margin: 0 -5px;
    padding: 0 30px;
    height: 37px;
    line-height: 37px;

}

Update: This method affects the styling on the rest of the menu.

Upvotes: 0

Aaron
Aaron

Reputation: 10440

Not sure why you've used the before and after elements. Seems to work if these are removed. http://jsfiddle.net/v7u3xsxk/5/

.tabrow {
    list-style: none;
    margin: 50px 0 0px;
    padding: 0;
    line-height: 35px;
    height: 37px;
    overflow: hidden;   
    font-family: Arial,Helvetica, sans-serif;
    /*position: relative;*/
    width:auto;
}

    .tabrow li {
        border: 1px solid #AAA;
        background: #D1D1D1;
        background: -o-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
        background: -ms-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
        background: -moz-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
        background: -webkit-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
        background: linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
        display: inline-block;
    border-radius: 5px 5px 0 0;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), inset 0 1px 0 #FFF;
        text-shadow: 0 1px #FFF;
        margin: 0 -5px;
        padding: 0 30px;
        height: 37px;
        line-height: 37px;

    }

    .tabrow a {
        color: #555;
        text-decoration: none;
    }

    .tabrow li.current {
        background: #FFF;
        color: #333;
        z-index: 2;
        border-top-color: #FFF;
    }



    .tabrow li.current {
        box-shadow: 2px 0px 0 #FFF;
    }

    .tabrow li.current {
        box-shadow: -2px 0px 0 #FFF;
    }

Upvotes: 1

Related Questions