Reputation: 2774
How can I add a border to the circle
icon from Font Awesome? Actually my result is:
The border is something like an ellipsis, instead a circular border.
<table class="table table-condensed table-hover table-striped">
<thead>
<tr>
<th></th>
<th>AAAA</th>
<th>AAAA</th>
<th>AAAA</th>
<th>AAAA</th>
<th>AAAA</th>
<th>AAAA</th>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 55px;" class="text-center" style="padding-top: 5px; width: 25px;"><span class="label label-success" style="margin-bottom: 3px; display: inline-block; width: 100%; height: 22px; padding-top: 2px;"><i class='fa fa-check' style="font-size: 18px;"></i></span><span style='position: relative; top: -15px; right: 0px; left: 15px;'><span class='fa-stack fa-lg'><i class='fa fa-circle fa-stack-2x text-info' style='border-radius: 100%; border: 2px solid #5cb85c;'></i><span class='fa fa-stack-1x fa-inverse' style='top: 3px;'>6</span></span></span></td>
<td>text</td>
<td>text</td>
<td>text</td>
<td>text</td>
<td>text</td>
<td>text</td>
</tr>
</tbody>
</table>
Upvotes: 5
Views: 6206
Reputation: 1
Try this:
.fa-circle {
text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;
}
Upvotes: 0
Reputation: 21
I used this code for Facebook icon, you can use it and customize it for yourself.
HTML:
<a class="align-items-center justify-content-center d-flex roundbutton text-decoration-none socialSignInBtns" href="#">
<i class="fab fa-facebook-f fa-fw" aria-hidden="true" style="color: #4267b2"></i>
</a>
CSS:
.socialSignInBtns {
display: block;
height: 5vw;
width: 5vw;
border-radius: 50%;
box-shadow: 0px 1px 10px 0px rgb(181, 165, 196);
border: 5px solid rgb(196, 189, 189);
}
.socialSignInBtns:hover {
opacity: 0.7;
}
Upvotes: 1
Reputation: 13489
You don't need to use FontAwesome for a bordered circle. It's actually easier to use pure CSS because you don't have to reset FontAwesome styling:
.circle-border {
display: inline-block;
color: black;
font: 18px sans-serif;
background: yellow;
border:2px solid green;
width: 30px;
height: 30px;
border-radius:17px; /* half of width + borders */
line-height: 34px; /* vertical center */
text-align: center; /* horizontal center */
}
<div class="circle-border">6</div>
Upvotes: 4
Reputation: 868
Added line-height: 30px;
on text-info
to fix the circle, and changed fa-inverse
top: 0px
to vertical center number 6
<i class="fa fa-circle fa-stack-2x text-info" style="border-radius: 100%; border: 3px solid #5cb85c; line-height: 30px;"></i>
<span class="fa fa-stack-1x fa-inverse" style="top: 0px;">6</span>
Upvotes: 4