Is there a list of browser conditionals for use including stylesheets?(是否有包括样式表在内的浏览器条件列表?)
问题描述
我见过人们在他们的 HTML 中做这样的事情:
I've seen people doing things like this in their HTML:
<!--[if IE]>
<link rel="stylesheet" href="ie.css" type="text/css" />
<![endif]-->
这是否适用于所有现代浏览器?是否有可以使用这种 if 语句的浏览器类型列表?
Does this work across all modern browsers and is there a list of browser types that will work with that kind of if statement?
编辑
谢谢罗斯.有兴趣了解 gt、lt、gte 和 <e.
推荐答案
这适用于所有浏览器,因为除了 IE 之外的任何浏览器都可以看到 <!--IGNORED COMMENT-->
.如果评论包含条件子句,则只有 IE 会读取评论.看看这篇文章
This works across all browsers because anything except IE sees <!--IGNORED COMMENT-->
. Only IE reads the comment if it contains a conditional clause. Have a look at this article
您还可以指定 IE 的版本.例如:
You can also specify which version of IE. For example:
<!--[if IE 8]>
<link rel="stylesheet type="text/css" href="ie8.css" />
<![endif]-->
这篇关于是否有包括样式表在内的浏览器条件列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:是否有包括样式表在内的浏览器条件列表?


- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- 失败的 Canvas 360 jquery 插件 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- addEventListener 在 IE 11 中不起作用 2022-01-01
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- 400或500级别的HTTP响应 2022-01-01
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- Flexslider 箭头未正确显示 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01