While @paislee's solution works, it is not ideal. When using the universal selector ( * ), each element is checked against it (since CSS maps from right to left). A better solution, especially if known to all child elements, should be to match individual elements. Ergo, button > img, button > span better than button > * .
button { padding: 1px 6px 1px 6px; } button > img, button > span { vertical-align: middle; }
<button> <img src="https://placehold.it/50x50" alt="Text" /> <span>Text</span> </button>
0b10011
source share