您的位置:首页 > Web前端 > CSS

在css使用PHP/ASP代码

2008-06-08 21:13 471 查看
http://www.corange.cn/archives/2008/06/1242.html 这个是我在使用的例子,当然也许有一些不足,这里写出来给大家参考下 当然在ASP中也是可以用的 我的这个例子是动态改变背景色,因为前台是生成静态页的,才考虑到用这个方法 先将CSS文件命名为php文件 <link href="../css/corange.css.php" rel="stylesheet" type="text/css"> _fcksavedurl=""../css/corange.css.php" rel="stylesheet" type="text/css">" _fcksavedurl=""../css/corange.css.php" rel="stylesheet" type="text/css">" _fcksavedurl=""../css/corange.css.php" rel="stylesheet" type="text/css">" 然后在CSS.PHP文件中 BODY { FONT-FAMILY: 宋体; color:#464646; font-size:12px; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #<?php require('../Connections/cn.php'); $sql22 = "select id,bgcolor from config where id=1"; $result22 = mysql_query( $sql22 ); $res_now22 = mysql_fetch_array($result22);//不能用mysql_fetch_row $bgcolor = $res_now22['bgcolor']; echo $bgcolor?>;; } 注意这段PHP代码不能放在顶部
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: