CSS3數(shù)字時(shí)鐘
來(lái)源:易賢網(wǎng) 閱讀:1343 次 日期:2015-09-02 15:29:14
溫馨提示:易賢網(wǎng)小編為您整理了“CSS3數(shù)字時(shí)鐘”,方便廣大網(wǎng)友查閱!

代碼如下:

<!DOCTYPE HTML>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>CSS3數(shù)字時(shí)鐘 DEMO</title>

<style type="text/css">

body {

background:#202020;

font:bold 12px Arial, Helvetica, sans-serif;

margin:0;

padding:0;

min-width:960px;

color:#bbbbbb;

}

a {

text-decoration:none;

color:#00c6ff;

}

h1 {

font: 4em normal Arial, Helvetica, sans-serif;

padding: 20px;

margin: 0;

text-align:center;

}

h1 small {

font: 0.2em normal Arial, Helvetica, sans-serif;

text-transform:uppercase;

letter-spacing: 0.2em;

line-height: 5em;

display: block;

}

h2 {

font-weight:700;

color:#bbb;

font-size:20px;

}

h2, p {

margin-bottom:10px;

}

@font-face {

font-family: 'BebasNeueRegular';

src: url('BebasNeue-webfont.eot');

src: url('BebasNeue-webfont.eot?#iefix') format('embedded-opentype'), url('BebasNeue-webfont.woff') format('woff'), url('BebasNeue-webfont.ttf') format('truetype'), url('BebasNeue-webfont.svg#BebasNeueRegular') format('svg');

font-weight: normal;

font-style: normal;

}

.container {

width: 960px;

margin: 0 auto;

overflow: hidden;

}

.clock {

width:800px;

margin:0 auto;

padding:30px;

border:1px solid #333;

color:#fff;

}

#Date {

font-family:'BebasNeueRegular', Arial, Helvetica, sans-serif;

font-size:36px;

text-align:center;

text-shadow:0 0 5px #00c6ff;

}

ul {

width:800px;

margin:0 auto;

padding:0px;

list-style:none;

text-align:center;

}

ul li {

display:inline;

font-size:10em;

text-align:center;

font-family:'BebasNeueRegular', Arial, Helvetica, sans-serif;

text-shadow:0 0 5px #00c6ff;

}

#point {

position:relative;

-moz-animation:mymove 1s ease infinite;

-webkit-animation:mymove 1s ease infinite;

padding-left:10px;

padding-right:10px;

}

@-webkit-keyframes mymove {

0% {

opacity:1.0;

text-shadow:0 0 20px #00c6ff;

}

50% {

opacity:0;

text-shadow:none;

}

100% {

opacity:1.0;

text-shadow:0 0 20px #00c6ff;

}

}

@-moz-keyframes mymove {

0% {

opacity:1.0;

text-shadow:0 0 20px #00c6ff;

}

50% {

opacity:0;

text-shadow:none;

}

100% {

opacity:1.0;

text-shadow:0 0 20px #00c6ff;

}

}

</style>

<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>

<script type="text/javascript">

$(document).ready(function() {

// Create two variable with the names of the months and days in an array

var monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ];

var dayNames= ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]

// Create a newDate() object

var newDate = new Date();

// Extract the current date from Date object

newDate.setDate(newDate.getDate());

// Output the day, date, month and year

$('#Date').html(dayNames[newDate.getDay()] + " " + newDate.getDate() + ' ' + monthNames[newDate.getMonth()] + ' ' + newDate.getFullYear());

setInterval( function() {

// Create a newDate() object and extract the seconds of the current time on the visitor's

var seconds = new Date().getSeconds();

// Add a leading zero to seconds value

$("#sec").html(( seconds < 10 ? "0" : "" ) + seconds);

},1000);

setInterval( function() {

// Create a newDate() object and extract the minutes of the current time on the visitor's

var minutes = new Date().getMinutes();

// Add a leading zero to the minutes value

$("#min").html(( minutes < 10 ? "0" : "" ) + minutes);

},1000);

setInterval( function() {

// Create a newDate() object and extract the hours of the current time on the visitor's

var hours = new Date().getHours();

// Add a leading zero to the hours value

$("#hours").html(( hours < 10 ? "0" : "" ) + hours);

}, 1000);

});

</script>

</head>

<body>

<div class="clock">

<div id="Date"></div>

<ul>

<li id="hours"> </li>

<li id="point">:</li>

<li id="min"> </li>

<li id="point">:</li>

<li id="sec"> </li>

</ul>

</div>

<p>來(lái)源:<a target="_blank">CSS3html5在線(xiàn)測(cè)試</a> 感謝:王濤</p>

<p>更多代碼請(qǐng)?jiān)L問(wèn):<a target="_blank">站長(zhǎng)技術(shù)教程網(wǎng)</a></p>

</body>

</html>

更多信息請(qǐng)查看IT技術(shù)專(zhuān)欄

更多信息請(qǐng)查看網(wǎng)頁(yè)制作
易賢網(wǎng)手機(jī)網(wǎng)站地址:CSS3數(shù)字時(shí)鐘
由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢(xún)回復(fù)僅供參考,敬請(qǐng)考生以權(quán)威部門(mén)公布的正式信息和咨詢(xún)?yōu)闇?zhǔn)!
相關(guān)閱讀網(wǎng)頁(yè)制作

2025國(guó)考·省考課程試聽(tīng)報(bào)名

  • 報(bào)班類(lèi)型
  • 姓名
  • 手機(jī)號(hào)
  • 驗(yàn)證碼
關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡(jiǎn)要咨詢(xún) | 簡(jiǎn)要咨詢(xún)須知 | 加入群交流 | 手機(jī)站點(diǎn) | 投訴建議
工業(yè)和信息化部備案號(hào):滇ICP備2023014141號(hào)-1 云南省教育廳備案號(hào):云教ICP備0901021 滇公網(wǎng)安備53010202001879號(hào) 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號(hào)
云南網(wǎng)警備案專(zhuān)用圖標(biāo)
聯(lián)系電話(huà):0871-65099533/13759567129 獲取招聘考試信息及咨詢(xún)關(guān)注公眾號(hào):hfpxwx
咨詢(xún)QQ:526150442(9:00—18:00)版權(quán)所有:易賢網(wǎng)
云南網(wǎng)警報(bào)警專(zhuān)用圖標(biāo)