我想这样做:
<link href="/style-render?s=base" rel="stylesheet" type="text/css">
当我访问 /style-render?s=base
时,它为我提供了我想要的 CSS,但样式没有被拉入页面。
它适用于谷歌:
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
所以我知道有可能我只是不知道自己做错了什么。
最佳答案
我刚刚想通了。
因此,由于我使用的是 CFML,因此我必须使用 cfcontent
标记来指定内容类型,如下所示:
<cfcontent type="text/css; charset=utf-8">
在 php 中你会这样做:
<?php
header( 'Content-Type: text/css; charset=UTF-8' );
?>
希望对某人有所帮助!
关于php - 如何使用查询字符串链接到服务器生成的 CSS 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31953269/