コンテンツ div にある角度の付いたタブの高度なスタイルに取り組んでいます。
:before および :after に従って div を形成するための提案を作成して、ほぼ解決しました。ただし、幅の代わりに最大幅を使用するように div 自体を取得しようとして立ち往生しています。
HTML
<br>
<div class="tab">Really really really really really really long content title</div>
<div class="tab-content">Content text</div>
CSS
.
tab-content, .tab, .tab:before, .tab:after {
background-color: #f5f5f5;
}
body {
background-color: #666;
}
.tab-content {
border-left: 1px solid blue;
border-right: 1px solid blue;
border-bottom: 1px solid blue;
border-top: 1px solid blue;
margin-top: -1px;
padding-top:10px;
padding-bottom:20px;
padding-left:10px;
padding-right:10px;
}
.tab:before {
}
.tab {
max-width: 150px;
display:block;
border-left: 1px solid blue;
border-top: 1px solid blue;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
height: 50px;
border-radius: 15px 100px 0px 0px;
position: relative;
z-index: 100000000;
line-height:50px;
padding-left:20px;
}
.tab:after {
border-right: 1px solid blue;
border-top: 1px solid blue;
border-top-left-radius: 0px;
border-top-right-radius: 10px;
border-bottom-right-radius: 0px;
border-bottom-left-radius: 00px;
display: block;
content:" ";
width: 150px;
height: 50px;
top: -1px;
position: absolute;
right: -28px;
transform:skewX(45deg);
-ms-transform:skewX(45deg);
-webkit-transform:skewX(45deg);
z-index: -1;
}
何か案は?
jsFiddle はこちら: http://jsfiddle.net/robmc/ZvEyx/9/