Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add border to fa-circle

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>
like image 637
Khrys Avatar asked Jun 12 '15 11:06

Khrys


2 Answers

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/

like image 140
Usman Arshad Avatar answered Nov 15 '22 11:11

Usman Arshad


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>
like image 29
Blaise Avatar answered Nov 15 '22 13:11

Blaise