建立自适应的HTML页面
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>ToDoList—最简单的待办事项列表</title>
<meta name="description" content="ToDoList无须注册即可使用,数据存储在用户浏览器的html5本地数据库里,是最简单最安全的待办事项列表应用!" />
<link rel="stylesheet" href="index.css">
</head>
<body>
<header>
<section>
<form action="javascript:postaction()" id="form">
<label for="title">ToDoList</label>
<input type="text" id="title" name="title" placeholder="添加ToDo" required="required" autocomplete="off" />
</form>
</section>
</header>
<section>
<h2 onclick="save()">正在进行 <span id="todocount"></span></h2>
<ol id="todolist" class="demo-box">
</ol>
<h2>已经完成 <span id="donecount"></span></h2>
<ul id="donelist">
</ul>
</section>
<footer>
<a href="javascript:clear();">clear</a>
</footer>
<script type="text/javascript" src="index.js"></script>
</body>
</html>
引入css样式
body {
margin:0;padding:0;font-size:16px;background: #CDCDCD;}
header {
height:50px;background:#333;background:rgba(47,47,47,0.98);}
section{
margin:0 auto;}
label{
float:left;width:100px;line-height:50px;color:#DDD;font-size:24px;cursor:pointer;font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;}
header input{
float:right;width:60%;height:24px;margin-top:12px;text-indent:10px;border-radius:5px;box-shadow