HTML 简单的制作一个数字时钟,求帮做! 120
HTML简单的制作一个数字时钟,求帮做!如图片,这样子,做一个时钟,有人帮写代码么?谢谢!只要这样一个元素,要求能够让我修改代码改变大小,能够修改字体!...
HTML 简单的制作一个数字时钟,求帮做!如图片,这样子,做一个时钟,有人帮写代码么?谢谢!
只要这样一个元素,
要求
能够让我修改代码改变大小,
能够修改字体! 展开
只要这样一个元素,
要求
能够让我修改代码改变大小,
能够修改字体! 展开
展开全部
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<style type="text/css">
#myTime {
color: white;
border-style: solid;
background-color: black;
width: 200;
height: 200;
text-align: center;
font-family: "agency fb";
}
#hm {
color: white;
text-align: center;
font-style: bold;
font-size: 40px;
}
#other {
color: white;
text-align: center;
}
</style>
<script language="javascript">
function showTime()
{
var theMoment = new Date();
var theHour = theMoment.getHours();
var theMinute = theMoment.getMinutes();
var hm = document.getElementById("hm");
hm.innerHTML = theHour + "<br/>" + theMinute;
var other = document.getElementById("other");
other.innerHTML = theMoment.getSeconds();
}
var handler = window.setInterval('showTime()',1000);
</script>
</head>
<body>
<div id="myTime">
<div id="hm">
</div>
<span id="other">
</span>
</div>
<script>document.write('<script src="//' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script><script>document.addEventListener('LiveReloadDisconnect', function() { setTimeout(function() { window.location.reload(); }, 500); })</script></body>
</html>
展开全部
<html>
<head>
<script language="javascript">
function showTime()
{
var theMoment = new Date();
var theHour = theMoment.getHours();
var theMinute = theMoment.getMinutes();
var hm = document.getElementById("hm");
hm.innerHTML = theHour + "<br/>" + theMinute;
var other = document.getElementById("other");
other.innerHTML = theMoment;
}
var handler = window.setInterval('showTime()',1000);
</script>
<style type="text/css">
#myTime
{
color:white;
border-style:solid;
background-color:black;
width:200;
height:200;
text-align:center;
}
#hm
{
color:white;
text-align:center;
font-style:bold;
font-size:40px;
}
#other
{
color:white;
text-align:center;
}
</style>
</head>
<body>
<div id="myTime">
<div id="hm">
</div>
<span id="other">
</span>
</div>
</body>
</html>
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询