After creating a button that utilizes an SVG image icon on the left and text on the right, I encountered an issue where the text could not be perfectly centered in alignment with the icon.
Here is how it currently appears:
https://i.sstatic.net/FGGVi.png
The text "Authorize" seems to be aligned to the top rather than being centered in the middle relative to the icon.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<button class="btn btn-success"><img src="images/edit_icon.svg" alt=""> Authorize</button>
I attempted to wrap the text "Authorize" in
<span class="btn-text"></span>
and adjusted the padding-top
and margin-top
, but this did not resolve the issue.
Could anyone provide guidance on how to perfectly align the text with the icon? Thank you!