Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要动态更改css的链接。在新加载的 css 中(更改路径后)有这样的组件:
@font-face { font-family:"DejaVu_Serif"; font-style:normal; font-weight:normal; src:url(../fonts/DejaVu_Serif/font001.ttf); }
但不幸的是,这些字体没有加载,有什么想法我能做什么?
您是否尝试过使用 PHP 创建要导入的 CSS 文件,然后通过快速 jQuery 调用将其加载到您的站点中...
var css = jQuery("<link>"); css.attr({ rel: "stylesheet", type: "text/css", href: "YOUR-PHP-FILE" }); $("head").append(css);
我在我之前的一个 PhoneGap 项目中使用了类似的东西,我希望为每个用户定制主题......也许这对你也有用。