我一直在使用Google Webfont 加载器来用漂亮的字体显示我网站的某些部分。我的这部分工作正常,我所有的<p>节目都用我想要的字体。但是,我希望只使用 webfonts 显示某些类<p>(即<p class="someclass">),然后使用常规字体(即不是 Google Webfonts)显示其余的类。我实现这一目标的最佳方法是什么?目前,我正在使用这个
<script type="text/javascript">
      WebFontConfig = {
        google: { families: [ 'McLaren' ] }
      };
      (function() {
        var wf = document.createElement('script');
        wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
            '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
        wf.type = 'text/javascript';
        wf.async = 'true';
        var s = document.getElementsByTagName('script')[0];
        s.parentNode.insertBefore(wf, s);
      })();
    </script>
    <style type="text/css">
      .wf-loading p.someclass {
        font-family: serif
      }
      .wf-inactive p.someclass {
        font-family: cursive
      }
      .wf-active p.someclass {
        font-family: 'McLaren', cursive
      }
    </style>
并且<p>整个页面都以“McLaren”字体显示。我确定我在使用 CSS 选择器做一些愚蠢的事情,但我不太确定是什么。
任何帮助将不胜感激。谢谢