css - middle align svg with inline text -
i have simple svg image inline text pasted here. how middle-align both text , icon vertically? tried usual ways middle align such setting negative martin-top
, use table-cell
no luck.
html:
<div class="imagelabel__label___yb88q"> <i class="imagelabel__icon___bfegt"> <svg id="layer_1" data-name="layer 1" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 32 32"> <title>email</title> <path d="..."></path> </svg> </i> john@gmail.com </div>
css:
svg { width: 25px; height: 25px; margin-right: 3px; }
svg { width: 25px; height: 25px; margin-right: 3px; vertical-align: middle; /*----- add property in svg -----*/ }
Comments
Post a Comment