创建一个html的基本模板,以后创建html可以参考:滑动显示.html
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="java,hadoop,mysql,nosql">
<meta name="description" content="Free tutorials of java programmer">
<link rel="stylesheet" type="text/css" href="mystyle.css">
<script type="text/javascript" src="jquery-1.8.3.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".flip").click(function(){
$(".panel").slideToggle("slow");
});
});
</script>
<style type="text/css">
div.panel,p.flip
{
margin:0px;
padding:5px;
text-align:center;
background:#e5eecc;
border:solid 1px #c3c3c3;
}
div.panel
{
height:120px;
display:none;
}
</style>
</head>
<body>
<div class="panel">
<h2>This is a heading</h2>
<p>W3School - 领先的 Web 技术教程站点</p>
<p>在 W3School,你可以找到你所需要的所有网站建设教程。</p>
</div>
<p class="flip">请点击这里</p>
</body>
</html>
mystyle.css的代码:
h2 {color:blue;}
文件结构:
还看到在head的meta元素:
<meta name="keywords" content="java,hadoop,mysql,nosql">
在keywords里写关键字,方便搜索引擎搜索.
以后再写JSP页面,也要考虑这个搜索关键词。
<meta http-equiv="content-type|default-style|refresh">
大多是使用的是content-type,并指定,其他两种方式不用管,refresh can be used to simulate an HTTP response header.
content="text/html;charset=UTF-8"
meta相关资料参考:
http://www.w3schools.com/tags/tag_meta.asp
http://www.w3schools.com/tags/att_meta_http_equiv.asp
有三种样式表:style
http://www.w3school.com.cn/html/html_css.asp
外部样式表
内部样式表
内联样式