In my opinion, it may seem like a lot of work, but here is how you can achieve it:
See the demo
Here is the HTML code:
<div class='outer'>
<div class='content'><!--your content here--></div>
<div class='label l1'></div>
<div class='label l2'></div>
</div>
And this is the CSS code:
.outer {
position: relative;
width: 500px;
border: solid .5em rgba(0,0,255,.5);
border-bottom: solid 0px transparent;
margin: 7em auto 0;
background: rgba(0,0,0,.5);
background-clip: padding-box;
}
.outer:before, .outer:after {
position: absolute;
top: 100%;
height: .5em;
background: rgba(0,0,255,.5);
content: '';
}
.outer:before { left: -.5em; width: 15%; border-left: solid .5em transparent; }
.outer:after { right: -.5em; width: 55%; border-right: solid .5em transparent; }
.content {
padding: .5em;
margin: 1.5em;
border-bottom: solid 1.5em transparent;
background: lightblue;
background-clip: padding-box;
}
.label {
overflow: hidden;
position: absolute;
top: 100%;
width: 15%;
height: 3em;
}
.l1 { left: 15%; }
.l2 { left: 30%; }
.label:before {
position: absolute;
top: -.5em;
width: 100%;
height: 2.5em;
border: solid .5em rgba(0,0,255,.5);
background: rgba(0,0,0,.5);
background-clip: padding-box;
content: '';
}
.l1:before { left: 9%; transform: skewX(30deg); }
.l2:before { right: 9%; transform: skewX(-30deg); }
This design is compatible with Firefox, Chrome, Opera, and Safari (although I recommend testing in IE9 as well). Keep in mind that for it to work properly, the width
value for .outer
must be a multiple of 100px
.
If the width
is not a multiple of 100px
, there might be some display issues in browsers other than Firefox and Chrome. In such cases, adjustments may need to be made, especially in Webkit-based browsers like Chrome.
Please note that if the width
is not a multiple of 100px
, the design may break in Opera and Safari: