【问题标题】:Glyphicon sometimes shows and sometimes doesnt show in my pageGlyphicon 有时会显示,有时不会显示在我的页面中
【发布时间】:2014-08-04 00:29:12
【问题描述】:

我从link 下载了 Bootstrap v3.1.1。我在我的 ASP.NET MVC 项目中使用 Glyphicon。

我面临的问题是,在我看来,我有时可以看到 Glyphicon 图标,但有时无法加载。我很困惑为什么会这样。这是我的 CSS :

<span class="glyphicon glyphicon-circle-arrow-right" style="font-size: 3em;color:grey;"></span>

我所做的是,我将 bootstrap.min.css 放在 Content 文件夹中,并将 Fonts 文件夹放在我的项目和内容文件夹之外。

我这样做的原因是,当我将字体文件夹放在内容中时,它根本没有显示。所以我确实喜欢这个。

项目结构:

项目名称->内容->bootstrap.min.css, bootstrap.css

项目名称->字体

我的代码:

<table>
    <tr>
        <td>

           <h3> Image <span class="glyphicon glyphicon-circle-arrow-right" style="font-size: 3em;color:grey;"></span></h3>

        </td>
    </tr>
</table>

【问题讨论】:

  • 向我们展示您的 HTML、CSS 和文件夹结构,否则我们无法帮助您
  • @Milanzor 我更新了我的帖子。请看一下。

标签: css twitter-bootstrap glyphicons


【解决方案1】:

不要更改默认文件夹结构,否则您可能需要更改 bootstrap.css 中的 url

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

让字体在目录目录下,这是默认的。

此外,这是引导程序中的一个已知问题,尤其是在您下载引导程序 3 的自定义版本时。

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

【讨论】:

    【解决方案2】:

    这对我有用,我已将字体放在测试文件夹下,一切正常

    【讨论】:

      【解决方案3】:

      <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
      
      <span class="glyphicon glyphicon-circle-arrow-right" style="font-size: 3em;color:grey;"></span>

      【讨论】:

      • 不要使用“@import”
      猜你喜欢
      • 1970-01-01
      • 2020-11-28
      • 2017-03-13
      • 1970-01-01
      • 1970-01-01
      • 2019-11-08
      • 1970-01-01
      • 2018-08-22
      • 2013-08-02
      相关资源
      最近更新 更多