【问题标题】:Coloring glyphicon separately单独着色字形
【发布时间】:2016-01-19 08:32:01
【问题描述】:

如果可能的话,我想以某种方式分别为 1 个字形着色。 为 Bootstrap 框架中称为“glyphicon-th-large”的字形的每个小方块着色。

【问题讨论】:

  • 不……不可能。字形是单个字符而不是单独的元素。

标签: javascript html css twitter-bootstrap glyphicons


【解决方案1】:

您使用类来选择字形图标,glyphicon-th-large 是该特定图标的类。 只需将样式添加到.glyphicon-th-large,每次使用该图标时,它都会有您选择的颜色。

这是您应该使用的样式(将颜色更改为您想要的任何颜色):

.glyphicon-th-large{
    color: red;
}

【讨论】:

    【解决方案2】:

    只需使用style="color:red" // or anything else

    <a style="color:red"><span class="glyphicon glyphicon-th-large"></span></a>
    

    【讨论】:

    • 我的意思是给 4 个小方块上色,一部分一部分。就像在这个标志中一样:growiee.com/img/partners/envienta.png
    • 使用字形图标是不可能的,您应该使用 4 个单独的 div,每个 div 包含不同的颜色和不同的图标。像这样jsfiddle.net/La6xk76a
    • 我认为您误解了我承认的不清楚的问题。我认为 OP 想要为 single 图标的不同部分着色。这显然是不可能的。
    猜你喜欢
    • 2017-06-05
    • 1970-01-01
    • 2020-07-04
    • 2017-12-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多