css minify/combine/param与PHP&Apache(对所有人都有用)
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了css minify/combine/param与PHP&Apache(对所有人都有用)相关的知识,希望对你有一定的参考价值。
compress & combine CSS files and param theme with php vars
/* in .htaccess */ AddType application/x-httpd-php .css // to parse PHP var /* on root CSS folder */ <?php function compress($buffer) { // remove comments // remove tabs, spaces, new lines ", " ", " ", " ", ' ', ' ', ' '), '', $buffer); // remove spaces return $buffer; } // include your PHP vars include 'cssvar.php'; // and insert all your CSS files include 'reset.css'; ?> /* in CSSVAR.PHP */ <?php $v_css_gradient_blue = " background: #b8c1d7; background: -webkit-gradient(linear, left top, left bottom, from(#dae3ee), to(#b8c1d7)); background: -moz-linear-gradient(top, #dae3ee, #b8c1d7); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dae3ee', endColorstr='#b8c1d7'); "; ?> /* Use in CSS files */ h1{ padding:0 0 15px 0; margin:0; font-size:180%; <?php echo $v_css_gradient_blue;?> }
以上是关于css minify/combine/param与PHP&Apache(对所有人都有用)的主要内容,如果未能解决你的问题,请参考以下文章