html的meta

  • 用meta进行页面重定向:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="Refresh" content="5;url=http://www.w3school.com.cn" />
</head>

<body>
<p>
对不起。我们已经搬家了。您的 URL 是 <a href="http://www.w3school.com.cn">http://www.w3school.com.cn</a>
</p>

<p>您将在 5 秒内被重定向到新的地址。</p>

<p>如果超过 5 秒后您仍然看到本消息,请点击上面的链接。</p>

</body>
</html>

<ul><li>//用javascript获取meta的content属性值</li><li><html>
<head>
<meta name="keywords" content="HTML, DHTML, CSS, XHTML, JavaScript" />
</head>
<body>


<script type="text/javascript">
x=document.getElementsByTagName("meta")[0];
document.write("Meta content: " + x.content);
</script>


</body>
</html>
</li></ul><div>
</div><div>3、查看httpEquiv</div><div><pre style="margin-top: 10px; margin-bottom: 0px; padding: 10px; border: 1px dotted rgb(119, 136, 85); font-family: Consolas, 'Courier New', Courier, monospace; width: 685px; background: rgb(245, 245, 245);"><html>
<head>
<meta http-equiv="refresh" content="5" />
</head>
<body>

<script type="text/javascript">
x=document.getElementsByTagName("meta")[0];
document.write("Http equiv: " + <code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, 'Courier New', Courier, monospace; color: rgb(0, 0, 221);">x.httpEquiv</code>);
</script>

</body>
</html>

1. <meta name="Description"content="信息参数"/>  代表说明网站的主要内容,概况是什么

2. <meta name="generator"content="信息参数"/>

代表说明网站的采用的什么软件制作

3. <meta name="author"content="信息参数">

代表说明网页版权作者信息

4. <meta name="COPYRIGHT" content="信息参数">

meta标签的COPYRIGHT的信息参数,代表说明网站版权信息。

5.<meta name="Robots"contect="信息参数">

Robots代表告诉搜索引擎机器人抓取哪些页面

4.  <meta http-equiv="Refresh"Content="时间;Url=网址参数">

meta标签的Refresh代表多少时间网页自动刷新,加上Url中的网址参数就代表,多长时间自动链接其他网址。

5. <meta http-equiv="Content-Type"content="text/html;charset=信息参数"/>

charset的信息参数如GB2312时,代表说明网站是采用的编码是简体中文;

6.<meta http-equiv="imagetoolbar"content="false"/>

指定是否显示图片工具栏,当为false代表不显示,当为true代表显示。

.<meta http-equiv="Content-Script-Type" content="text/javascript">  W3C网页规范,指明页面中脚本的类型。

8.<meta http-equiv="pragma" content="no-cache">

代表禁止浏览器从本地计算机的缓存中访问页面内容,这样设定,访问者将无法脱机浏览。 

9.<meta name="revisit-after" content="7days">

revisit-after代表网站重访,7days代表7天,依此类推

10.<meta http-equiv="X-UA-Compatible" content="IE=edge">

对IE8新增的设置,页面采用edge进行渲染,防止在IE8下表现不正常

11    <meta content="telephone=no,email=no" name="format-detection" />

规定页面是否进行格式检测

12.    <meta name="renderer" content="webkit">

优先用哪种浏览器内核渲染页面


                
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值