标签:style io ar sp for java on div bs
<SCRIPT language="JavaScript">
function disptime(){
var time = new Date();
var hour = time.getHours();
var minute = time.getMinutes();
var second = time.getSeconds();
var year = time.getFullYear();
var month = time.getMonth() + 1;
var date = time.getDate();
var day0 = time.getDay();
var day = "";
switch(day0){
case 1:day = "星期一";break;
case 2:day = "星期二";break;
case 3:day = "星期三";break;
case 4:day = "星期四";break;
case 5:day = "星期五";break;
case 6:day = "星期六";break;
case 0:day = "星期日";break;
}
minute="0"+minute;
if (second < 10)
second="0"+second;
var time = year + "/" + month + "/" + date + " " + day + " " + apm + " " + hour + ":" + minute + ":" + second;
document.getElementById("clock").innerHTML = time;
setTimeout("disptime()",1000);
}
</SCRIPT>
<body leftmargin="0" topmargin="0" class="footer" onload="disptime()">
<form NAME="myform">
<span style="float:right" id="clock"></span>
<span style="float:center">XXXXXXXXXXXXXXXXXX</span>
</form>
</body>
</html>
PS:
IE中float布局将center写在前会导致right的换行显示,这时需要将right的写在前面,即可解决。
chrome中前后无影响。
标签:style io ar sp for java on div bs
原文地址:http://www.cnblogs.com/zhangxiaoguai/p/4151841.html