添加边框到fa-circle

时间:2015-06-12 11:42:17

标签: css font-awesome

如何在Font Awesome中为circle图标添加边框?其实我的结果是:

http://jsfiddle.net/0jhdvj0k/

边框类似于省略号,而不是圆形边框。

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

3 个答案:

答案 0 :(得分:4)

您不需要将FontAwesome用于镶边圆圈。它实际上更容易使用纯CSS,因为你不必重置FontAwesome样式:

&#13;
&#13;
<div id="demo"></div>
&#13;
    .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 */
    }
&#13;
&#13;
&#13;

答案 1 :(得分:4)

line-height: 30px;上添加了text-info来修复圈子,并将fa-inverse top: 0px更改为垂直中心号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/

答案 2 :(得分:1)

我将此代码用于Facebook图标,您可以使用它并为自己进行自定义。

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