时间与问候自动更新
1、把如下代码加入<body>与</body>区域中:
<p align="center">
<font color="#FF9900">
<script language="JavaScript">
<!-----------
var enabled = 0; today = new Date();
var day; var date;
if(today.getDay()==0) day = "星期日"
if(today.getDay()==1) day = "星期一"
if(today.getDay()==2) day = "星期二"
if(today.getDay()==3) day = "星期三"
if(today.getDay()==4) day = "星期四"
if(today.getDay()==5) day = "星期五"
if(today.getDay()==6) day = "星期六"
document.fgColor = " FF0072";
date1 = "<font size=2 color=#FF9900>" + (today.getYear()) + "年" + (today.getMonth() + 1 ) + "月" + today.getDate() + "日 " + "</font>";
date2 = "<font size=2 color=#FF9900>" + day + "</font>";
document.write("" + date1.fontsize(3) + date2.fontsize(3) + "");
//----->
</script> <script language="javaScript">
<!--
now = new Date(),hour = now.getHours()
if(hour < 6){document.write("凌晨好!")}
else if (hour < 9){document.write("早上好!")}
else if (hour < 12){document.write("上午好!")}
else if (hour < 14){document.write("中午好!")}
else if (hour < 17){document.write("下午好!")}
else if (hour < 19){document.write("傍晚好!")}
else if (hour < 22){document.write("晚上好!")}
else {document.write("夜里好!")}
// -->
</script>
2、在<head>与</head>之间加入代码统一字号:
<STYLE type=text/css>A:link { COLOR: #000000; TEXT-DECORATION: none } A:visited { COLOR: #000000; TEXT-DECORATION: none } A:active { COLOR: #800000; TEXT-DECORATION: underline } A:hover { COLOR: #800000; TEXT-DECORATION: underline } BODY { FONT-SIZE: 9pt; FONT-FAMILY: "宋体", "Arial" } TABLE { FONT-SIZE: 9pt; FONT-FAMILY: "宋体", "Arial" } TD { FONT-SIZE: 9pt; FONT-FAMILY: "宋体", "Arial" } TR { FONT-SIZE: 9pt; FONT-FAMILY: "宋体", "Arial" }</STYLE>