您现在的位置:小学生自学网>> 信息>> 学习电脑

几个不常见的meta标签的用法

作者: 来源: 发布时间:2010年04月29日 点击数:
 

<META HTTP-EQUIV="imagetoolbar" CONTENT="no" />

可以禁止出现那个“图像工具栏”(出现在图片左上角,有四个按钮的)。

另外如果你不想整页都禁用 imagetoolbar,可以只针对某个 <img> 标签加个 GALLERYIMG="no" 属性。


<META HTTP-EQUIV="MSThemeCompatible" Content="No" />

如果用的是 Windows XP 而且选用的是那个时髦的样式,IE 里的按钮也会跟着变,不过这会影响很多事情,诸如按钮的颜色、大小等,用了这个标签可以将 button 等恢复成普通样式。


<meta name="MSSmartTagsPreventParsing" content="true" />

If you don't want Microsoft products to automatically generate smart tags on your web pages, then simply include this tag. It must be included on each page of your site for which you do not desire this feature. It has no effect on smart tags which you insert yourself.

简单的说就是防止微软页面编辑软件在页面上自动添加标签,保证代码本来面貌


  X-UA-Compatible

  X-UA-Compatible是针对ie8新加的一个设置,对于ie8之外的浏览器是不识别的,这个区别与content="IE=7"在无论页面是否包含指令,都像是使用了 Windows Internet Explorer 7的标准模式。而content="IE=EmulateIE7"模式遵循指令。对于多数网站来说,它是首选的兼容性模式。

  目前IE8尚在测试版中,所以为了避免制作出的页面在IE8下面出现错误,建议直接将IE8使用IE7进行渲染。也就是直接在页面的header的meta标签中加入如下代码:
<meta http-equiv="X-UA-Compatible" content="IE=7" />
  这样我们才能使得页面在IE8里面表现正常!

关于X-UA-Compatible的其它几个用法:

<meta http-equiv="X-UA-Compatible" content="IE=5" />
像是使用了 Windows Internet Explorer 7 的 Quirks 模式,这与 Windows Internet Explorer 5 显示内容的方式很相似。

<meta http-equiv="X-UA-Compatible" content="IE=7" />
无论页面是否包含 <!DOCTYPE> 指令,都像是使用了 Windows Internet Explorer 7 的标准模式。

<meta http-equiv="X-UA-Compatible" content="IE=8" />

<meta http-equiv="X-UA-Compatible" content="edge" />
Edge 模式通知 Windows Internet Explorer 以最高级别的可用模式显示内容,这实际上破坏了“锁定”模式。

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
EmulateIE7 模式通知 Windows Internet Explorer 使用 <!DOCTYPE> 指令确定如何呈现内容。标准模式指令以Windows Internet Explorer 7 标准模式显示,而 Quirks 模式指令以 IE5 模式显示。与 IE7 模式不同,EmulateIE7 模式遵循 <!DOCTYPE> 指令。对于多数网站来说,它是首选的兼容性模式。