How to Pass Numbers in Bootstrap 3 Glyphicons

浪子不回头ぞ 提交于 2020-01-02 01:10:10

问题


Is there any option or solution to pass Numbers is Bootstrap 3 Glyphicons like

Thanks


回答1:


Is there any option or solution to pass Numbers is Bootstrap 3 Glyphicons?

In short, no. Here are all the available glyphicons.

Glyphicons either come as an image file or font set. Either way, they are not extensible. They are individual icons. It's like saying, I know there's a character set of a-z, but can it also have a icon of a puppy. Or I know this is an image of an apple, but can the pixels change so it's a number.


You can, of course, easily do this with CSS. It's a trivial implementation, so I wouldn't worry about the 'cost of extra classes'. If you're developing a website, you should have plenty of classes.

Try any of the suggestions from how to use CSS to surround a number with a circle?:

Use Border Radius

<div class="numberCircle">30</div>
.numberCircle {
    border-radius: 50%;
    behavior: url(PIE.htc); /* remove if you don't care about IE8 */
    width: 36px;
    height: 36px;
    padding: 8px;
    background: #fff;
    border: 2px solid black;
    color: black;
    text-align: center;
    font: 32px Arial, sans-serif;
    display: inline-block;
}

Use Unicode Characters

For 20 and lower, you can just use the enclosed_alphanumerics unicode characters:

&#9312;
&#9313;
&#9314;
&#9315;
&#9316;
&#9317;

① ② ③ ④ ⑤ ⑥

Demo in jsFiddle



来源:https://stackoverflow.com/questions/25650553/how-to-pass-numbers-in-bootstrap-3-glyphicons

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!