IE条件语句IE hack大全__第1页
IE条件语句IE hack大全__第2页
IE条件语句IE hack大全__第3页
IE条件语句IE hack大全__第4页
IE条件语句IE hack大全__第5页
免费预览已结束,剩余1页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、IE条件语句IE hack大全_ Conditional comments work as follows: 代码如下: !-if IE 6Special instructions for IE 6 here!endif- code Their basic structure is the same as an HTML comment (!- -). Therefore all other browsers will see them as normal comments and will ignore them entirely. IE, though, has been programm

2、ed to recognize the special !-if IE syntax, resolves the ifand parses the content of the conditional comment as if it were normal page content. Since conditional comments use the HTML comment structure, they can only be included in HTML files, and not in CSS files. Id have preferred to put the speci

3、al styles in the CSS file, but thats impossible. You can also put an entire new link tag in the conditional comment referring to an extra style sheet. Example Below I added a lot of conditional comments that print out messages according to your IE version. Note however, that if you use multiple Expl

4、orers on one computer, the conditional comments will render as if all these Explorer versions are the highest Explorer version available on your machine (usually Explorer 6.0). Test Below are a few conditional comments that reveal the IE version youre using. According to the conditional comment this

5、 is IE According to the conditional comment this is IE 7 According to the conditional comment this is IE lower than 9 According to the conditional comment this is IE lower or equal to 7 According to the conditional comment this is IE greater than 6 Code The syntax I use is: code p class=accent !-if

6、IE According to the conditional comment this is IEbr / !endif- !-if IE 6 According to the conditional comment this is IE 6br / !endif- !-if IE 7 According to the conditional comment this is IE 7br / !endif- !-if IE 8 According to the conditional comment this is IE 8br / !endif- !-if IE 9 According t

7、o the conditional comment this is IE 9br / !endif- !-if gte IE 8 According to the conditional comment this is IE 8 or higherbr / !endif- !-if lt IE 9 According to the conditional comment this is IE lower than 9br / !endif- !-if lte IE 7 According to the conditional comment this is IE lower or equal

8、to 7br / !endif- !-if gt IE 6 According to the conditional comment this is IE greater than 6br / !endif- !-if !IE - According to the conditional comment this is not IEbr / !- !endif- /p Note the special syntax: gt: greater than lte: less than or equal to Also note the last one. It has a different sy

9、ntax, and its contents are shown in all browsers that are not IE: 代码如下: !-if !IE - CSS hack? Are conditional comments CSS hacks? Strictly speaking, yes, since they can serve to give special style instructions to some browsers. However, they do not rely on one browser bug to solve another one, as all

10、 true CSS hacks do. Besides, they can be used for more than CSS hacks only (though that rarely happens). Since conditional comments are not based on a browser hack but on a deliberate feature I believe they are safe to use. Sure, other browsers could implement conditional comments, too (though as yet none have done so), but theyre unlikely to react to the specific query !-if IE. I use conditional comments, though sparingly. First I see if I can find a real CSS solution to an Explorer Windows problem. If I cant, though, I dont hesitate to use them. Comment tag A reader told me IE

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论