Using material icons with CSS, I have the following code that renders a link with icon and text.
<a href="#"><i class="material-icons">group_work</i>Groups</a>
As you can see in the image below, the text seems to be sinking down.. I would like them to be vertically aligned center together. How can i achieve this?
PS. (Not a designer!)
To vertically center elements, you can use the
vertical-algin: middle;
rule. In your case, that would most propably be:Here is an example with your dark button:
Will do the trick ;)
vertical-align
:middleapplied to the icon
i` can be the simplest option but results can be inconsistent.I have found better results with setting the link to
display:inline-flex
but the dfference is quite subtle.vertical-align
can still be used as a fallback for non-supporting browsers.