这段代码可以使你的网站
12点以前使用早上的css风格,
过了12点,站点会自动替换成下午的风格,
5点后则替换成夜晚的风格。

用PHP实现:
[php]<link rel="stylesheet" type="text/css"
href="<?php $hour = date("H"); if ($hour < 12) echo "morning.css"; elseif ($hour < 17) echo "day.css"; else echo "night.css"; ?>
" />[/php]
用ASP实现:
[html]
<link rel="stylesheet" type="text/css" href="<%
if hour(now)<12 then
response.write "a.css"
else
if hour(now)<17 then
response.write "b.css"
else
response.write "c.css"
end if
end if
%>" />[/html]
用JavaScript实现:
[js]<link rel="stylesheet" type="text/css" href="a.css" id="sitecss" />
<script language="JavaScript">
function trunCss() {
var today = new Date();
var time = today.getHours();
var cssurl = "";
if (( time>=0) && (time < 7 ))
cssurl="1.css"
if (( time >= 7 ) && (time < 12))
cssurl="2.css"
if (( time >= 12) && (time < 14))
cssurl="3.css"
if (( time >=14) && (time < 18))
cssurl="4.css"
if ((time >= 18) && (time <= 22))
cssurl="5.css"
if ((time >= 22) && (time < 24))
cssurl="6.css"
document.getElementById("sitecss").href=ccsurl
}
trunCss();
</script>
[/js]