首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Glyphicons显示为方形(bootstrap 3.2.0)

Glyphicons显示为方形(bootstrap 3.2.0)
EN

Stack Overflow用户
提问于 2015-10-16 17:24:30
回答 3查看 1.8K关注 0票数 1

我正在尝试使用以下内容加载搜索图标:

代码语言:javascript
复制
<div tabindex="6" class="glyphicon glyphicon-search">...<.div>

但是,字形图标加载如下:

解决方案是什么?

代码语言:javascript
复制
background-color:none transparent}@font-face{font-family:'Glyphicons Halflings';src:url(/css/fonts/glyphicons-halflings-regular.eot);src:url(/css/fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(/css/fonts/glyphicons-halflings-regular.woff) format('woff'),url(/css/fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(/css/fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular)

EN

回答 3

Stack Overflow用户

发布于 2015-10-16 23:41:30

这是从Bootstrap site下载的Bootstrap3.2.0

解压并运行下面的代码

代码语言:javascript
复制
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <link rel="stylesheet" href="bootstrap3.2.0/css/bootstrap.min.css">
</head>
<body>
    <div tabindex="6">
        <span class="glyphicon glyphicon-search"></span>
    <div>
</body>
</html> 

工作方式与BS3.5类似

票数 1
EN

Stack Overflow用户

发布于 2015-10-16 19:26:45

检查此代码

代码语言:javascript
复制
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
</head>
<body>
    <div tabindex="6">
        <span class="glyphicon glyphicon-search"></span>
    <div>
</body>
</html> 
票数 0
EN

Stack Overflow用户

发布于 2017-05-05 11:01:13

尽管回答晚了,但对于有这个问题的人来说:

在标签中使用Bootstrap的CDN为我解决了这个问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33166827

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档