Add border to fa-circle

6k views Asked by At

How can I add a border to the circle icon from Font Awesome? Actually my result is:

http://jsfiddle.net/0jhdvj0k/

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>
4

There are 4 answers

0
Usman Arshad On BEST ANSWER

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>

http://jsfiddle.net/1qzqu83m/

1
Blaise On

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>

1
Sai Rohit On

Try this:

.fa-circle {
  text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;
}
0
Hamid.r Fahimi On

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;
}