【问题标题】:Bootstrap validation symbol(correct and wrong symbol) font is missing缺少引导验证符号(正确和错误符号)字体
【发布时间】:2016-02-12 07:58:56
【问题描述】:

我正在为我的网站使用 bootstrap.min.css 进行引导验证。我已经完成了验证,但是缺少字体给我带来了障碍。我添加了一个屏幕短片。请告诉我为什么缺少字体?

bootstrap.min.css 中的代码

.glyphicon-ok:before {
    content: "\e013"
}
.glyphicon-remove:before {
    content: "\e014"
}

它正在萤火虫中,请检查它。 我已经尝试了很多,但无法修复它。 先感谢您。 任何建议将不胜感激。

【问题讨论】:

    标签: html css jqbootstrapvalidation bootstrapvalidator


    【解决方案1】:

    你的问题有很多未知数,

    您使用的是什么版本的bootstrapvalidatorbootstrap

    你是否在 JS 中包含了feedback icons

    feedbackIcons: {
        valid: 'glyphicon glyphicon-ok',
        invalid: 'glyphicon glyphicon-remove',
        validating: 'glyphicon glyphicon-refresh'
    },
    

    您是从本地服务器加载bootstrap.cssbootstrap.min.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.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg');
    }
    

    从 CDN 服务器加载 bootstrap.css

    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.css"/>
    

    如果显示字体图标,则在本地 bootstrap.css 文件中检查字体路径和文件夹名称是否正确,字体文件是否存在且文件名称是否正确。

    要获得正确的字体,请访问Bootstrap homepage 并下载完整的 .zip 文件。从那里提取四个字体文件到您的字体目录,一切都应该正常。

    【讨论】:

    • 这里我正在加载 bootstrap.min.css 如果我使用的是 直接字体来了。
    • 我接受了你的回答,这对我很有帮助。否则我将从验证中删除该字体部分
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-03-09
    • 2014-08-03
    • 2021-03-30
    • 2016-06-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多