概要:rray("rn", "r", "n", "t", ' ', ' ', ' '), '', $buffer); return $buffer; } /* 所有的CSS文件 */ include('master.css'); include('typography.css'); include('grid.css'); include('print.css'); include('handheld.css'); ob_end_flush(); 使用方法1. 在浏览器中打开上面的 css-compress.php 文件,即可输出压缩后的CSS源代码,保存即可。【推荐】2. 直接调用css-compress文件,代码如下:【不推荐】<link rel="stylesheet" href="css-compress.php" type="text/css" media="all">
使用PHP来压缩CSS文件,http://www.99xxk.com减少CSS文件的大小能有效减少页面的加载时间,改善用户体验。本文将介绍一种利用php来压缩CSS文件的方法。
新建css-compress.php文件
使用方法
1. 在浏览器中打开上面的 css-compress.php 文件,即可输出压缩后的CSS源代码,保存即可。【推荐】
2. 直接调用css-compress文件,代码如下:【不推荐】
<link rel="stylesheet" href="css-compress.php" type="text/css" media="all">