HTML学习1--写网页的基本模板

创建一个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
外部样式表
内部样式表
内联样式

转载于:https://my.oschina.net/forrest420/blog/102566

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值