Updated question:
I have a bunch of DIV, they are part of a menusystem and are displayed using display:inline-box. Each div contains text. I want to have different background-color on the different DIVs and that the background fills up the whole height of the div and I also want the text to be vertically aligned along all the div. The fiddle below shows that the background color is only used around the text.
Old text: I've spent hours on this. I found the vertical alignment quite easy (for example here: How to vertically align div inside another div without display:table-cell) but cannot figure out how i i can fill the whole div with the background color.
My example code is on fiddle: http://jsfiddle.net/joche/s7beksLt/
<div class="DivParent">
<div class="DivWhichNeedToBeVerticallyAligned bg1">
one line
</div>
<div class="DivWhichNeedToBeVerticallyAligned bg2">
<p>one line</p>
</div>
<div class="DivWhichNeedToBeVerticallyAligned bg3">
<p>one line</p>
<p>two line</p>
</div>
<div class="DivHelper"></div>
</div>
css:
.DivParent {
height: 100px;
border: 1px solid lime;
white-space: nowrap;
background-color:#deadad;
}
.DivWhichNeedToBeVerticallyAligned {
display: inline-block;
vertical-align: middle;
white-space: normal;
}
.bg1 {
background-color:#ffaaff;
}
.bg2 {
background-color:#ffffff;
}
.bg3 {
background-color:#ffffa9;
height:100%
}
.DivHelper {
display: inline-block;
vertical-align: middle;
height:100%;
}