【问题标题】:@font-face in rails 2.3.8rails 2.3.8 中的@font-face
【发布时间】:2013-09-26 09:15:49
【问题描述】:

你好,有人知道如何在字体空间和 rails 应用程序中包含字体吗.. 我使用的是 rails 2.3.8

我将字体文件夹放在公用文件夹中 我的css在下面给出..但它不工作任何人都可以帮助我。

我的 CSS

 @font-face {
            font-family: 'Conv_code128';
            src: url('fonts/code128.eot');
            src: local('☺'), url('fonts/code128.woff') format('woff'), url('fonts/code128.ttf') format('truetype'), url('fonts/code128.svg') format('svg');
            font-weight: normal;
            font-style: normal;
        }

查看页面

<div style= "  float: left;
          font-family: 'Conv_code128';
          font-size: 25px;
          margin-left: 50px;">
    <%= hai %>
  </div>

【问题讨论】:

    标签: css ruby-on-rails fonts ruby-on-rails-2


    【解决方案1】:

    尝试将字体上传到您的服务器并尝试使用此代码

    <style type="text/css">
    @font-face {
        font-family: "My Custom Font";
        src: url(http://www.example.org/mycustomfont.ttf) format("truetype");
    }
    p.customfont { 
        font-family: "My Custom Font", Verdana, Tahoma;
    }
    </style>
    <p class="customfont">Hello world!</p>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-08-12
      • 1970-01-01
      • 2010-12-06
      • 2011-10-13
      • 2011-04-03
      • 1970-01-01
      • 1970-01-01
      • 2012-08-26
      相关资源
      最近更新 更多