I have used text-align: left;
in the css class name-tag
but somehow the name is still aligned to the right hand side of the div. Why?
.container {
width:500px;
position:absolute;
display:table;
border: 2px solid red;
}
.img-circle {
background: yellow;
border-radius: 50%;
width: 60px;
height: 60px;
border: 2px solid #666;
font: 32px Arial, sans-serif;
display: table-cell;
text-align: center;
vertical-align: middle;
}
.name-tag {
display:table-cell;
padding-left:75px;
vertical-align: middle;
text-align: left;
border: 1px solid black;
}
<div style="container">
<div class='img-circle'>
AK
</div>
<div class='name-tag'>
Aaron King
</div>
</div>
Sample code can be found here: http://jsfiddle.net/kongakong/6Lrfwt7m/3/
The outcome is this: