Hey there! I'm currently working on designing a website header using bootstrap 3, which consists of four main divs. Within each of these divs, there are two nested divs.
Imagine one of the initial divs as shown below:
___________________________________
| |
| |
| 180,00€ Total |
|---------------------------------|
| for the last 30 days |
| |
|_________________________________|
My goal is to have text similar to the example above within each of the four divs. The "180,00€" and "Total" are displayed as inline-block spans. I want the upper text aligned at the bottom and the lower text aligned at the top.
If you'd like to see a live demo, feel free to check out this link: JSFIDDLE
Here is the HTML structure:
<div class="row stats-row">
<div class="col-sm-3 col-xs-6 stat"></div>
<div class="col-sm-3 col-xs-6 stat"></div>
<div class="col-sm-3 col-xs-6 stat"></div>
<div class="col-sm-3 col-xs-6 stat">
<div class="data">
<span class="data-num">81,00€</span>
<span class="num-desc">total</span>
</div>
<div class="data-desc">last 30 days</div>
</div>
</div>
And here is the CSS styling:
.row.stats-row {
-webkit-box-shadow: 0px 0px 1px 0px rgba(218, 227, 233, 0.5);
-moz-box-shadow: 0px 0px 1px 0px rgba(218, 227, 233, 0.5);
box-shadow: 0px 0px 1px 0px rgba(218, 227, 233, 0.5);
background-color: #f9f9f9;
padding: 0px;
margin: 0px !important;
}
.row.stats-row .stat {
border-right: 1px solid #dae3e9;
border-bottom: 1px solid #dae3e9;
height: 80px;
-webkit-box-shadow: inset 0px 0px 1px 0px rgba(218, 227, 233, 0.5);
-moz-box-shadow: inset 0px 0px 1px 0px rgba(218, 227, 233, 0.5);
box-shadow: inset 0px 0px 1px 0px rgba(218, 227, 233, 0.5);
}
/* EDIT BELOW */
.stats-row .stat .data{
text-align: center;
height: 50%;
}
.stats-row .stat .data-desc{
text-align:center;
height:50%;
color:#777;
font-style: italic;
font-family: 'Open Sans', sans-serif, Arial;
}
.stats-row .stat .data > span{
display: inline-block;
height:100%;
line-height:100%;
vertical-align: baseline;
}
.stats-row .stat .data .data-num{
margin-right:20px;
color: #32a0ee;
font-size: 25px;
}
.stats-row .stat .data .num-desc{
color: #29323a;
font-weight: bold;
font-size: 16px;
}
#monthGraphs .portlet-header h3{
text-align:center;
}
.graph{
width:100%;
}