亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

時間日期小案例

原創(chuàng) 2019-02-21 13:14:31 173
摘要:<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><style>.data{width:400px;height:500px;background-color: #A6BBCB;position: absolute;left: 50

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<style>

.data{width:400px;height:500px;background-color: #A6BBCB;position: absolute;left: 50%;top:50%;margin-top:-250px;

margin-left:-200px;box-shadow: 0px 0px 20px #1C1C1C;border-radius: 5px; }

.up{width:93%;height:50px;background-color: rgba(255, 255, 255, 0.3);border-radius: 4px;

margin:5px auto;line-height:50px;padding-left:15px;font-size: 25px;color:#ff6500;font-weight: bolder;}

.down{font-size:80px;color:#ff6500;font-weight: bolder;text-align: center;line-height: 280px;}

.down1{font-size:30px;color:#ff6500;font-weight: bolder;text-align: center;line-height: 50px;}

</style>

<title>日期案例</title>

</head>

<body>

<div class="data">

<div class="up">

今天是地球公元:<span class="up_year" id="up_yea"></span> 年<span  class="up_month" id="ups"></span>月

</div>

<div class="down" id="a"></div>

<div class="down1" id="h"></div>

</div>


<script type="text/javascript">

var yea,mont,dat,h

window.onload=function(){

var today = new Date();

yea=document.getElementById("up_yea")

yea.innerHTML=today.getFullYear();

mont=document.getElementById("ups");

mont.innerHTML=today.getMonth()+1;

dat=document.getElementById("a");

dat.innerHTML=today.getDate()+"日";

h=document.getElementById("h");

h.innerHTML=today.getHours()+"時"+today.getMinutes()+"分"+today.getSeconds()+"秒";

}

</script>

</body>

</html>



批改老師:韋小寶批改時間:2019-02-21 13:17:12
老師總結(jié):js中的時間函數(shù)在實際的開發(fā)中也是經(jīng)常會用到的 沒事的時候記得要多練習(xí)哦!

發(fā)佈手記

熱門詞條