Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove part of border

Tags:

html

css

I have a widget which cannot be wrapped in another div.

My question is how do I remove the border from the header/title-bar but still keep it around the remainder of the DIV? Example below.

Adding a border to only .body isn't feasible because if an end-user adds padding to the bottom/top of the widget div things break.

Image issue

<div class="widget">
    <div class="header">Header Title</div>
    <div class="body">My Content</div>
</div>


.widget {
    height: 100px;
    width: 130px;
    border: 3px solid blue;
    position: absolute;
    overflow: hidden;
}
.header {
    width: 100%;
    min-height: 24px;
    max-height: 24px;
    display: block;
    background-color: grey;
    color: white;
}
.body {
    width: 100%;
    height: calc(100% - 24px);
}

http://jsfiddle.net/botwfngv/

like image 713
Dennis Avatar asked Sep 30 '22 17:09

Dennis


1 Answers

.widget {
    height: 100px;
    width: 130px;
    border: 3px solid blue;
    position: absolute;
}
.header {
    width: 100%;
    min-height: 24px;
    max-height: 24px;
    display: block;
    background-color: grey;
    color: white;
    margin: -3px;
    padding: 3px;
}
.body {
    width: 100%;
    height: calc(100% - 24px);
}

http://jsfiddle.net/botwfngv/2/

like image 55
Cheery Avatar answered Oct 03 '22 00:10

Cheery