Jon Bridge Jon Bridge - 3 years ago 265
HTML Question

Why is the `a href` tag changing my icon position?

How can I link the user to a page using

a href
from a font-awesome icon when the user clicks onto it. Code is below HTML.

<div class="features-icons-icon d-flex">
<a href=''><i class="fa fa-desktop m-auto fa-5x text-danger"></i></a>

Remove the a href and you will see the position change.

I want the icon to link to google but be in the same vertical line one after the other. For example like the other two icons which have not got the a href tag code.

Answer Source

The a tag is overriding the styles applied to the i tag. Consider setting margin for that particular a tag as:

.features-icons-icon > a{
    margin: 0px auto;

Fiddle or it didn't happen!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download