【发布时间】:2016-11-29 00:21:09
【问题描述】:
我意识到存在与此类似的问题,问题是未引用正确的字体系列。但是,在我使用的版本中,他们不使用导航箭头的图标,他们使用 html 字符代码作为双左双右箭头。
我的 html 引用 -
<link href="Content/css/bootstrap.css" rel="stylesheet" />
<link href="Content/css/datepicker.css" rel="stylesheet" />
<link href="Content/css/navbar.css" rel="stylesheet" />
<link href="Content/css/jquery-ui.min.css" rel="stylesheet" />
<link href="Content/css/jquery-ui.structure.min.css" rel="stylesheet" />
<link href="Content/css/jquery-ui.theme.min.css" rel="stylesheet" />
<script type= "text/javascript" src="Scripts/jquery-2.2.0.min.js"></script>
<script type= "text/javascript" src="Scripts/bootstrap.min.js"></script>
<script type= "text/javascript" src="Scripts/bootstrap-datepicker.js"></script>
<script type= "text/javascript" src="Scripts/moment.min.js"></script>
<script type= "text/javascript" src="Scripts/jquery-ui.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$(".datepicker").datepicker({
format: 'dd/mm/yyyy',
autoclose: true,
todayBtn: 'linked',
useCurrent: true,
ignoreReadonly: true
})
});
</script>
这是 bootstrap-datepicker.js 文件中的相关编码 -
headTemplate: '<thead>'+
'<tr>'+
'<th colspan="7" class="datepicker-title"></th>'+
'</tr>'+
'<tr>'+
'<th class="prev">«</th>'+
'<th colspan="5" class="datepicker-switch"></th>'+
'<th class="next">»</th>'+
'</tr>'+
'</thead>',
contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>',
footTemplate: '<tfoot>'+
'<tr>'+
'<th colspan="7" class="today"></th>'+
'</tr>'+
'<tr>'+
'<th colspan="7" class="clear"></th>'+
'</tr>'+
'</tfoot>'
};
我得到的只是与一般标题背景相同的灰色,然后是正常的蓝色“悬停”,就像我在日历上的任何特定日子一样。
我在其他 .css 文件中查找了冲突的“.prev”定义,但没有看到任何特定于表、日期选择器或标题的定义。我也尝试过使用字形图标替换编码,结果相同。
我的小提琴 -
【问题讨论】:
-
你的精灵文件,它们是否在引导程序正在寻找的目录中?
-
在这种情况下,可能需要一个小提琴,以便我们可以检查您正在使用的各种 CSS 和 JS 中的任何冲突。
-
你应该包含
glyphicons-halflings-regular文件 -
@demo - 我确实在字体目录中有该文件,并且它确实被 bootstrap.css 引用。但是,既然它没有使用任何字体系列的图标,为什么需要它呢?当我在页面正文中使用 html 字符编码 («) 时,它显示得很好,仅供参考。
-
@Robert C - 我将检查如何设置它,并在完成后进行编辑。谢谢!
标签: javascript html css twitter-bootstrap datepicker