十年網(wǎng)站開發(fā)經(jīng)驗 + 多家企業(yè)客戶 + 靠譜的建站團隊
量身定制 + 運營維護+專業(yè)推廣+無憂售后,網(wǎng)站問題一站解決
html
成都創(chuàng)新互聯(lián)于2013年創(chuàng)立,先為懷仁等服務(wù)建站,懷仁等地企業(yè),進行企業(yè)商務(wù)咨詢服務(wù)。為懷仁企業(yè)網(wǎng)站制作PC+手機+微官網(wǎng)三網(wǎng)同步一站式服務(wù)解決您的所有建站問題。
head
meta http-equiv="Content-Type" content="text/html; charset=gb2312"
meta name="keywords" content="js特效" /
meta name="description" content="js特效網(wǎng)" /
title年月日分秒全部顯示的時間代碼/title
/head
body onload=startclock()
form name="clock"
script language="JavaScript"
var timerID = null;
var timerRunning = false;
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;}
function startclock () {
stopclock();
showtime();}
function showtime () {
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds()
var timeValue = now.getYear()+"年"+(now.getMonth()+1)+"月"+now.getDate()+"日" +((hours = 12) ? " 下午 " : " 上午 " )
timeValue += ((hours 12) ? hours -12 :hours)
timeValue += ((minutes 10) ? ":0" : ":") + minutes
timeValue += ((seconds 10) ? ":0" : ":") + seconds
document.clock.thetime.value = timeValue;
timerID = setTimeout("showtime()",1000);
timerRunning = true;}
/script
input name="thetime" style="font-size: 9pt;color:#000000;border:1px solid #FFFFFF; ; " size="28"/form
/body
/html
diva href="#" style="float:left; text-align:left; margin-left:10px;"文字列表內(nèi)容/aspan style="clear:both;float:right; margin-right:20px;"時間/span/div
至于時間不顯示年,要改js代碼,一般是把年份隱藏,有是系統(tǒng)時間,要代碼控制的。
line-height是行高,height就是高,通常height是對于某個框架或者圖片來弄的,line-height用于文字
如果要實際效果你可以寫一段文字,分好幾行,然后對它做line-height屬性,就會注意到變化了
比如:
div style="line-height:20px;"abcbr/abcbr/abcbr/abcbr/abcbr//div
調(diào)整20px這個值,行間距就會發(fā)生變化
你確定這是CSS?
用這個setInterval();
var time=function(){你寫的代碼}
setInterval(time,1000);