Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67441

Icon is not showing vertically centered inside a circular tag

$
0
0

I am trying to create a circle with a tag and putting icon inside that circle. But that icon is coming little down.

<body>
    <a><i class="fab fa-facebook-f"></i></a>
</body>

* {
  box-sizing: border-box;
}

body {
  background: black;
}

a {
  display: inline-block;
  padding: 1rem;
  border: 1px solid #fff;
  cursor: pointer;
  border-radius: 50%;
  margin-right: 1rem;
  width: 44px;
  height: 44px;
  text-align: center;
  transition: all 0.2s;
}

i {
  color: white;
}
<html><head><title>Page Title</title><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.css" /></head><body><a><i class="fab fa-facebook-f"></i></a></body></html>

Demo: https://jsfiddle.net/pujan_shah/cdb86fqo/2/


Viewing all articles
Browse latest Browse all 67441

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>