html - What is the best/right way to vertical centralize this with css? -
i want vertical centralize "red" square text. have inner <a>
inside div, doens't know if affect something... css below works, seems have vertical-align: middle;
in every single tag. know how make more simple same html tree? thanks!
html:
<div> <a href="#"></a> </div> <span>testing...</span>
css:
div{ display: inline-block; margin: 0 3px; vertical-align: middle; } a{ width: 5px; height: 5px; background-color: red; display: block; vertical-align: middle; } span{ font-size: 26px; vertical-align: middle; }
only span needs vertical-align rule.
span{ font-size: 26px; vertical-align: middle; }
Comments
Post a Comment