【发布时间】:2015-06-29 23:14:48
【问题描述】:
Glyphicon 在我的开发服务器中呈现为空矩形。
设置
from unipath import Path
BASE_DIR = Path(__file__).ancestor(2)
STATICFILES_DIRS = (BASE_DIR.child("static", "static_dirs"), )
STATIC_URL = '/static/'
模板
{% load staticfiles %}
<span class="glyphicon glyphicon-heart"></span>
<span class="glyphicon glyphicon-calendar"></span>
bootstrap.css/bootstrap.min.css
src: url('../fonts/glyphicons-halflings-regular.eot');
src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
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');
网址
urlpatterns = patterns('',
url(regex = r'^$',
view = 'tesglyph.views.testglyph'),
) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
当我添加到
base.html
<head>
(...)
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css" rel="stylesheet">(...)
</head>
我得到了心脏,但不是日历!
我该如何解决这个问题?
【问题讨论】:
-
您是否检查了生成的 html 的准确性?一个有效而另一个无效的一个原因很可能是拼写错误或类名冲突
标签: django twitter-bootstrap glyphicons