html meta标签以及实现页面跳转

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<! DOCTYPE html>
< html lang="enuix">
< head >
     <!-- 编码 -->
     < meta charset="UTF-8">
 
     <!-- 头部放置的跳转代码-->
     < meta http-equiv="Refresh" content="3 url=http://pan.baidu.com">
 
     <!-- 关键字 -->
     < meta name="keywords" content="html,code">
 
     <!-- 描述 -->
     < meta name="description" content="测试站点">
 
     <!-- IE浏览器指定文件兼容性模式 X-UA-Compatible -->
     < meta http-equiv="X-UA-Compatible" content="IE=EnulateIE7"/>
     
     < title >测试</ title >
</ head >
< body >
     < a href="http://www.baidu.com">百度</ a >
</ body >
</ html >

http-equiv就是在HTTP头部指定了一些服务器返回给浏览器的有用信息

属性作用 
http-equivcontent-type设置页面的字符集<meta http-equiv="content-Type" content="text/html; charset=utf-8"> html5页面的做法是直接使用<meta charset="utf-8"/>
 expires设置页面的过期时间<meta http-equiv="expires" content="Wed, 20 Jun 2007 22:33:00 GMT">
 refresh自动刷新到新页面

<meta http-equiv="Refresh" content="2;URL=http://www.net.cn/"> //2代表页面停留多长时间后跳转都后面的网址上

 set-cookie如果cookie过期,则自动删除本地cookie<meta http-equiv="Set-Cookie" content="cookievalue=xxx;expires=Wednesday, 20-Jun-2007 22:33:00 GMT; path=/">
 pragma禁止浏览器从本地调用缓存<meta http-equiv="Pragma" content="no-cache">
 window-target强制页面在浏览器窗口独立显示<meta http-equiv="Window-target" content="_top">
 page_enter, page_exit设定进入页面和退出页面的效果<meta http-equiv="Page-Exit"    contect="revealTrans(duration=1.0,transtion= 12)">
 cache-control清除缓存<meta http-equiv="cache-control" content="no-cache">

name把content的内容关联到一个名称上,html和xhtml都没有执行固定的name值,可以自由使用对自己和源文档的读者来说富有意义的名称

属性作用实例
nameauthor指定页面的所有者<meta name="author" content="James Bond"/>
 description页面描述,用于搜索引擎收录<meta name="description" content="中国设计网是中国起步最早的设计门户网站,设计师的网上家园"/>
 keywords页面关键词,用于被搜索引擎收录<meta name="keywords" content="设计, 师妹"/>
 generator用于说明网站制作生成工具<meta name="generator" content="Microsoft"/>
 revised网页文档的修改时间<meta name="revised" content="设计网, 6/24/2015"/>
 viewport用于控制页面缩放<meta name=”viewport” content=”width=240, height=320, user-scalable=yes, initial-scale=2.5, maximum-scale=5.0, minimun-scale=1.0”> //width指定页面的可视宽度, 像素值或device-width, initial-scale设置页面初始化时的缩放比例,user-scalable指定是否可以缩放可视区域, maximum-scale, minimun-scale页面最大最小缩放比例。 如果想要页面在不同的设备都按照页面的设计尺寸缩放(那些宽度固定的网站)就不要使用viewport属性
 copyright网页版权信息<meta name="copyright" name="Copyright 2015 Ironside"/>
 renderer使用哪种模式显示网页

<meta name="renderer" content="webkit|ie-comp|ie-stand"> webkit标示使用webkit内核打开页面, ie-comp 使用IE兼容模式打开,


  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值