Looking to use the pseudo selectors :before
and :after
to create a border around a div with images, but running into some issues. The :after
image is not positioning correctly on the right side of the element and the text is dropping below the image. Check out this JsFiddle example for more details.
CSS
.panel {
border:2px solid #634e32;
border-radius:4px;
margin-bottom: 30px;
background-color: #ecd8b5;
}
.panel-header{
margin: -5px -1px 10px 2px;
padding-left: 15px;
background:url('http://eaassets-a.akamaihd.net/lougame/cdn/409444/resource/webfrontend/ui/win_mainoverlay_t.png') repeat-x;
}
.panel-header:before,
.panel-header:after{
content:"";
width:9px;
height:36px;
overflow:hidden;
}
.panel-header:before {
content: url('http://eaassets-a.akamaihd.net/lougame/cdn/409444/resource/webfrontend/ui/win_mainoverlay_tl.png');
margin-left:-20px;
}
.panel-header:after {
content: url('http://eaassets-a.akamaihd.net/lougame/cdn/409444/resource/webfrontend/ui/win_mainoverlay_tr.png');
}
HTML
<div class="panel">
<div class="panel-header">Header Title Goes Here</div>
</div>