html头部
来源:互联网 发布:wow7.0前夕插件mac 编辑:程序博客网 时间:2024/04/30 15:46
(1)<head>元素
包含了所有的头部标签元素
(2)<titile>元素
定义了浏览器中显示的标题
<!DOCTYPE html><html><head><title>Title of the document</title></head><body>The content of the document......</body></html>
(3)<base>元素
定义基本的超链接地址,这样的话其他链接只用在这个url的基础上再加上其余路径就好。如果没有定义就可以使用这个作为默认
<head><base href="http://www.w3cschool.cc/images/" target="_blank"></head>
(4)<link>元素
通常用来链接样式表,也就是css文件
<head><link rel="stylesheet" type="text/css" href="mystyle.css"></head>
(5)<meta>元素
用来描述一些基本的元数据
1.http-equiv
看名字就知道是和http头部一样的作用,能够给浏览器传递http头部的一些有用信息。对于值,可以content中
<meta http-equiv="参数" content="参数变量值">1)expires
可以用于设定网页的到期时间。网页一旦过期,必须到服务器上重传
<meta http-equiv="expires" content="Wed, 20 Jun 2007 22:33:00 GMT">注意:必须使用GMT的时间格式
2)refresh
自动刷新,并能够指向新页面
<meta http-equiv="Refresh" content="2;URL=http://www.net.cn/">也就是2秒后自动刷新到新的url网址
3)content-Type
设定页面格式和使用的字符集
<meta http-equiv="content-Type" content="text/html; charset=gb2312">
4)set-cookie
如果网页过期,就会删除保存的cookie
<meta http-equiv="Set-Cookie" content="cookievalue=xxx;expires=Wednesday, 20-Jun-2007 22:33:00 GMT; path=/">
5)keywords
给搜索引擎用的
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
6)description
页面描述
<meta http-equiv="description" content="This is my page">
2.name
主要用来定义这个html的描述、关键字、作者等。对于值,可以content中
<meta name="参数" content="参数变量值">1)description
描述信息
<meta name="description" content="Free Web tutorials">
2)keywords
告诉搜索引擎关键字是什么
<meta name="keywords" content="HTML,CSS,JavaScript">
3)author
作者
<meta name="author" content="Hege Refsnes">
(6)<script>元素
用来在html页面中插入或引入一段javascript
1.src
用来引入一个js
1)绝对url,指向另外一个网站
<script src="http://www.example.com/example.js">2)相对url,指向网站内的一个文件
<script src="/scripts/example.js">
2.type
<script type="text/javascript">
- html头部
- html头部
- Html头部
- HTML头部
- HTML 头部
- HTML 头部
- html头部
- html头部
- HTML头部标记
- HTML文档头部标记
- HTML头部,元信息
- html 头部样式
- HTML头部信息
- HTML--头部标签
- html头部标签
- HTML 头部元素
- html头部详解
- 常用 HTML 头部标签
- 黑马程序员——网络编程
- 【JQuery】write less,do more
- pycharm4.5.1 注册码 破解
- 谈谈我自己(创业四个多月)
- Rails接口(interface)入门
- html头部
- gvim配置及相关插件安装(过程详细,附图)
- Handler 刷新
- Chrome 浏览器主页被 hao123 篡改解决办法
- 欢迎使用CSDN-markdown编辑器
- 设计模式 模版方法模式 展现程序员的一天
- silverlight AutoCompleteBox控件的SelectionChanged的里问题解决
- 从Eclipse ADT 切换到 Android Studio遇到的问题及解决办法汇总
- Nginx配置问题