html - 如何使用 Twitter bootstrap 3 显示日历图标

标签 html css twitter-bootstrap

我试图在我的 C# MVC View 中实现一个日期时间选择器,但我的输入框右侧的日历图标没有出现。

我正在按照 here 中的示例进行操作.

我的部分观点

<script src="/Scripts/angular-0.10.0.min.js"></script>
        <link rel="stylesheet" type="text/css" href="/Content/bootstrap/css/bootstrap.min.css" >
        <link rel="stylesheet" type="text/css" href="/Content/bootstrap/css/bootstrap-responsive.min.css" >
        <script src="/Scripts/jquery-lib/jquery-1.10.2.min.js"></script>
        <script src="/Content/bootstrap/js/bootstrap.min.js"></script>


        <script type="text/javascript" src="http://tarruda.github.com/bootstrap-datetimepicker/assets/js/bootstrap-datetimepicker.min.js">
    </script>
        <script  data-main="/Scripts/main" src="~/Scripts/require.min.js"></script>


 <div id="datetimepicker2" class="input-append">
                           <input data-format="MM/dd/yyyy HH:mm:ss PP" type="text"/>
                        <span class="add-on">
                            <i data-time-icon="icon-time" data-date-icon="icon-calendar">
                            </i>
                        </span>
                    </div>

我试过像下面这样显式地说明字形图标的路径,但没有用:

   @iconSpritePath:     "/Content/bootsrap/img/glyphicons-halflings.png";

我最终得到这个错误:

The name 'iconSpritePath' does not exist

我还注意到我的 Twitter bootsrap 3 类不包含 icon-calender 类。

如何让日历图标出现?

最佳答案

来自官方 Bootstrap 文档:

随着 Bootstrap 3 的发布,图标已移至单独的存储库。这使主要元素尽可能精简,使人们更容易交换图标库,并使 Glyphicons 图标字体更容易被 Bootstrap 以外的更多人使用。

这就是您使用它的方式。说明在这里:http://glyphicons.getbootstrap.com/

<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0-rc2/css/bootstrap-glyphicons.css" rel="stylesheet">
<span class="glyphicon glyphicon-calendar"></span>

关于html - 如何使用 Twitter bootstrap 3 显示日历图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18290850/

相关文章:

html - 如何在使用 jquery mobile 按住该 div 时隐藏/删除和复制该 div

html - 如何将 HTML 格式和标签从 JSON url 引入 Swift 3

css - 为大尺寸设置媒体查询

javascript - Bootstrap Accordion 崩溃问题

javascript函数不断刷新页面

javascript - 使用 Javascript 或 Jquery 更改 Canvas 值

html - 如何更改 MUI 自动完成输入框的右填充?

html - 简单的 CSS 问题,设置按钮大小的样式

css - Sass 中的 `@each` 循环声明动态 id?

html - 使用 Bootstrap 类时无法解决问题