Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Tabs border with triangle with CSS

Tabs border with triangle with CSS

Problem

Tab border <strong>CSS3</strong>

I am trying to represent my HTML/CSS tab like on the picture.

I have already tried lots of things with border-radius without any success. Do you have any tracks so that I can reproduce my tabs like the picture only with CSS?

Problem courtesy of: toregua

Solution

In order to make the same borders (also inside the triangles) as in the image, you can use pseudo elements and transform rotate :

DEMO

output :

enter image description here

HTML :

Critiques
Messages sur le forum
Actualités

CSS :

div{
    border-top:1px solid #ccc;
    border-bottom:1px solid #ccc;
    padding-right:12px;
    line-height:50px;
    float:left;
    width:200px;
    position:relative;
    z-index:0;
    text-align:center;
}

div:after,div:before{
    content:'';
    position:absolute;
    width:10px;
    height:10px;
    background:#fff;
    z-index:999;

    -ms-transform: rotate(45deg);
    -webkit-transform: rotate(45deg);
    transform: rotate(45deg);
}

div:before{
    border-right:1px solid #ccc;
    border-bottom:1px solid #ccc;
    top:0; left:-12px;

     -ms-transform-origin:100% 0;
    -webkit-transform-origin:100% 0;
    transform-origin:100% 0;
}

div:after{
    border-left:1px solid #ccc;
    border-top:1px solid #ccc;
    bottom:0;
    right:4px;

     -ms-transform-origin:0 100%;
    -webkit-transform-origin:0 100%;
    transform-origin:0 100%;
}
div:first-child:before, div:last-child:after{
    display:none;
}
Solution courtesy of: web-tiki

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

Tabs border with triangle with CSS

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×