您的位置:首页 > Web前端 > HTML

HTML高级(头元素)

2012-09-09 23:52 253 查看
头元素是指位于<head></head>标签对之间的元素

1,<title></title>

设置标题

2,<base>

用于指定网页中超链接的基准地址,以改变网页中所有使用相同

地址的URL的基准地址

例如:

<base href="http://www.baidu.com/teack/" target="_blank">

作用:

1,href属性指定该网页中所有使用HTTP协议的相对URL地址的

基准地址,若网页中有如<a href="index.html"></a>这样的超连接

它不会再像没有使用<base>标签时那样,表示当前网页相同目录下的网页文件

2,target属性用于设定该网页中所有的超连接显示的目标窗口,

在<base>标签中设定target属性,可省得所有的超连接<a>标签中都加上

target属性。

3,<link>:定义当前文档与另一文档或资源的关系

主要属性:

href:另一文档或资源的URL,必选

rel,rev:link的两个资源之间的关系类型,必须具有2者中的一个,必选

rel:

rev:

值:

contents

index

glossary

copyright

next

previous

start

help

bookmark

stylesheet

alternate

shortcut icon:图标,16*16像素

<link rel="shortcut icon" href="favicon.ico">

title:描述目标资源的字符串,可选

type:目标资源类型

type="text/css"

type="text/javascript"

media:媒体

值:

screen:显示器

print:打印机

projection:投影仪

aural:扬声器

braille:触觉,感觉设备

tty:电传打字机

tv:电视机

all:所有设备

4,<meta>

属性:

http-equiv:http响应消息头

值:

Content-Type:浏览器文本编码

<html>

<head>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
</head>

<body>
啊哈哈
</body>

</html>


Refresh:自动刷新

<!--
1秒后自动刷新
-->
<meta http-equiv="Refresh" content="1">

<!--
1秒后进行跳转
-->
<meta http-equiv="Refresh" content="1;url=http://www.baidu.com">


Expires:设置缓存日期

<!--
content="0" 表示禁用浏览器缓存页面
-->
<meta http-equiv="Expires",content="Mon,12 May 2001 00:20:00 GMT">


Widows-Target:强制显示
<meta http-equiv="Windows-Target" content="_top">


Pragma:禁止缓存当前页面

<meta http-equiv="Pragma" content="no-cache">

<!--
也可以这样
-->
<meta http-equiv="Cache-Control" content="no-cache">


Page-Enter和Pager-Exit

设置网页开始和结束的显示方式

<meta http-equiv="Page-Enter" content="revealTrans(Transition=23,Duration=1.000)">


name:

值:

keywords

description

robots(此时content的值可为:index,noindex,follow,nofollow,all,none)

generator

author

copyright
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: