<!DOCTYPE html>
<html>
<head>
<meta charset=”UTF-8″>
<title>倒计时</title>
<style>
*{
margin: 0;
padding:0;
}
body,html{
width: 100%;
height: 100%;

使用css样式实现动态网页

用法:

}
header{
padding-top:20%;
height:63%;
background:-webkit-radial-gradient(red,yellow);
}
p {
font-size: 100px;
text-align: center;
color: #A52A2A;
}
p span {
color: brown;
}
p span.time {
color: blueviolet;
}
</style>
</head>
<body>
<header>
<p>距离全面建成小康社会还有</p>
<p><span></span></p>
</header>
</body>
<script>
var oSpan = document.getElementsByTagName[0];
function tow {//自动补零函数
return n >= 0 && n < 10 ? ‘0’ + n :n;
}
function getDate() {//计算倒计时时间的函数
var newTime = new Date(‘2020/1/1 00:00:00’);//输入未来的日子
var oldTime = new Date();//获取现在的日子
var second = Math.floor((newTime – oldTime) /
1000);//未来时间距离现在的秒数
var day = Math.floor(second /
86400);//整数部分代表的是天;一天有24*60*60=86400秒 ;
second = second % 86400;//余数代表剩下的秒数;
var hour = Math.floor(second / 3600);//整数部分代表小时;
second %= 3600; //余数代表 剩下的秒数;
var minute = Math.floor(second / 60);
second %= 60;//余数代表 剩下的秒数;
var str = tow + ‘<span >天</span>’

html:

   WebRequestSugar ws = new WebRequestSugar();            //可选参数            //ws.SetAccept            //ws.SetContentType            //ws.SetCookie            //ws.SetTimeOut            //ws.SetIsAllowAutoRedirect            //GET            var html= ws.HttpGet("http://localhost:24587/Http/HttpTest.aspx");            //带参GET            var paras=new Dictionary<string, string>() ;            paras.Add("name","skx");            paras.Add("id", "100");            var html2 = ws.HttpGet("http://localhost:24587/Http/HttpTest.aspx",paras );            //POST            var postHtml= ws.HttpPost("http://localhost:24587/Http/HttpTest.aspx", paras);            //post and file            var postHtml2 = ws.HttpUploadFile("http://localhost:24587/Http/HttpTest.aspx", "文件地址可以是数组", paras);

发表评论

电子邮件地址不会被公开。 必填项已用*标注