I have structure:
.itemWrapper{
position: relative;
width: 100%;
display: inline-block;
height: 20%;
}
.itemNumber{
position: relative;
float:left;
height: 100%;
width: 20%;
}
.itemName{
height: 100%;
width: 20%;
position: relative;
float:left
}
<div class = "itemWrapper">
<div class = "itemNumber">2</div>
<div class = "itemName"> name </div<
</div>
I need to center the text inside .itemNumber
and .itemName
vertically, how can I do that? I know about line-height
trick, however the height of the container is in %, what is the way to do it?