html - Setting label width for tabs -


i'm messing this code sample css tricks , trying set 3 tabs width 33% of containers width, 3 tabs evenly cover top of container. know can set width of labels display:block, label starts cutting container. how can adjust width without damaging container?

here's solution fiddle: http://jsfiddle.net/qewef/

essentially:

.tab {   float: left;   width:33%;   display:block;   margin-top:-12px; } .tab label {   background: #eee;    padding: 10px;    border: 1px solid #ccc;    margin-left: -1px;    position: relative;   left: 1px;    display:block; } 

the margin-top on tab out padding/border exists on tab label.


Comments