• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

解决bootstrap 图标不显示的问题

武飞扬头像
PHP中文网
帮助83

Bootstrap字体图标不显示问题

问题:

bootstrap使用字体图标时只显示一个框,不显示图标。

问题分析:

出现的原因是:bootstrap.css文件没有正确关联上字体文件glyphicons-halflings-regular.eot。

查看bootstrap.css源码可知:

`@font-face {
  font-family: 'Glyphicons Halflings';
  src: url('../fonts/glyphicons-halflings-regular.eot');
  src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}`

注意当中的url

解决办法:

把从网上下载的整个bootstrap丢到eclipse中。如图

学新通技术网

在jsp页面中的引用:

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>bootStrap表单</title>
<script type="text/javascript" src="https://www.swvq.com/bootstrap/js/jquery.min.js"></script>
<link rel="stylesheet" href="https://www.swvq.com/bootstrap/js/bootstrap-3.3.7-dist/css/bootstrap.css">
<script type="text/javascript" src="https://www.swvq.com/bootstrap/js/bootstrap-3.3.7-dist/js/bootstrap.js"></script>
</head>

注意:jQuery的引用要放在bootstrap引用前,否则会报Uncaught Error: Bootstrap's JavaScript requires jQuery的错误

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanfifka
系列文章
更多 icon
同类精品
更多 icon
继续加载