show.php:echo "a{color:red}";
test.php:(注意link连接标签)<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link type="text/css" rel="stylesheet" href="show.php">
</head>
<body>
<a>333</a>
</body>
</html>
其运行结果在IE6中通过,在FF中无效果,个人暂时估计原因就是href的值一定是css后缀名的.
有没办法不通过<style>echo...</style>的方法来获取CSS数据.
test.php:(注意link连接标签)<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link type="text/css" rel="stylesheet" href="show.php">
</head>
<body>
<a>333</a>
</body>
</html>
其运行结果在IE6中通过,在FF中无效果,个人暂时估计原因就是href的值一定是css后缀名的.
有没办法不通过<style>echo...</style>的方法来获取CSS数据.
例:
.red {
color:red
}
在test,.php 里面
<link rel="stylesheet" type="text/css" href="show.css" />
假如要用的话:
<label id="label1" class="red">333</label> //red 就是在show.css里面定义的一个css类!
AddType application/x-httpd-php .css如果是IIS自己添加解释就可以了