【问题标题】:Cufon font not working. Anyone please advise?Cufon 字体不工作。有人请指教吗?
【发布时间】:2013-03-25 15:57:10
【问题描述】:

我无法在网站上使用这种 Cufon 字体。代码有什么问题吗?我附上了代码的截图。不知道为什么代码没有使用标签正确实现。

http://i.stack.imgur.com/K1DKS.jpg

我的代码有什么问题吗?

【问题讨论】:

  • 您没有加载 cufon js 文件。

标签: html css cufon


【解决方案1】:

您没有加载 cufon js 文件。

Cufon 的使用方法如下:

https://github.com/sorccu/cufon/wiki/Usage

<!doctype html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Playing with Cufón</title>
        <!-- Stylesheets here, before all scripts. Helps avoid styling issues. -->
        <link rel="stylesheet" type="text/css" href="style.css" />
        <!--
        If you want to use complex selectors with Cufón, load a selector engine (JavaScript framework) here.
        We support jQuery, Sizzle, MooTools, Dojo, Prototype and other popular frameworks.
        -->
        <script src="cufon-yui.js" type="text/javascript"></script>
        <script src="YourFont.font.js" type="text/javascript"></script>
        <script type="text/javascript">
            Cufon.replace('h1'); // Works without a selector engine
            Cufon.replace('#sub1'); // Requires a selector engine for IE 6-7, see above
        </script>
    </head>
    <body>
        <h1>Your custom font here</h1>
        <h2 id="sub1">Your custom font here too</h2>
        <!-- To avoid delays, initialize Cufón before other scripts at the bottom -->
        <script type="text/javascript"> Cufon.now(); </script>
        <!-- Google Analytics and other scripts here -->
    </body>
</html>

【讨论】:

  • 不用担心,很高兴为您提供帮助。
猜你喜欢
  • 2011-11-23
  • 2010-11-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-03-31
  • 1970-01-01
  • 1970-01-01
  • 2012-04-06
相关资源
最近更新 更多