How does div sub
set div center
to middle?
Text can be different, so margin or line-height in this situation is not a good solution.
CSS:
.center {
background-color: #336699;
width: 200px;
height: 200px;
}
.sub {
display: inline-block;
vertical-align: middle;
}
HTML:
<div class="center">
<span class="sub">
Some text text...
</span>
</div>