如果他们使用的是Internet Explorerv9之前的版本,我想将我们网站的用户反弹到错误页面.我们的时间和金钱都不值得支持IE pre-v9.所有其他非IE浏览器的用户都很好,不应该被退回.这是建议的代码:
if(navigator.appName.indexOf("Internet Explorer")!=-1){ //yeah, he's using IE
var badBrowser=(
navigator.appVersion.indexOf("MSIE 9")==-1 && //v9 is ok
navigator.appVersion.indexOf("MSIE 1")==-1 //v10, 11, 12, etc. is fine too
);
if(badBrowser){
// navigate to error page
}
}
Run Code Online (Sandbox Code Playgroud)
这个代码会起作用吗?
关闭一些可能会出现的评论:
useragent字符串.我并不担心.pre-v9 IE浏览器都不支持.在整个站点中按功能检查功能将是一种浪费.IE v1(或> = 20)访问该网站不会将'badBrowser'设置为true,并且警告页面将无法正确显示.这是我们愿意承担的风险.IE 10,使得这种方法绝对无用.还有其他明显的问题需要注意吗?
我怎样才能为IE 11破解或编写CSS?我有一个在IE 11中看起来很糟糕的网站.我只是在这里搜索,但还没有找到任何解决方案.
有没有css选择器?
我有一个继承的项目,有些地方是一个彻头彻尾的混乱.这是其中之一.我需要只针对IE(任何版本).
#nav li {
float: left;
height: 54px;
background: #4f5151;
display: table;
border-left: 1px solid grey;
}
Run Code Online (Sandbox Code Playgroud)
需要说明的是:在嵌入式样式表中,如果没有为html中的标记添加ID或类,我只需要在用户使用IE时应用边框样式.我怎样才能做到这一点?
编辑:找到Firefox的解决方案,编辑问题以反映这一点.
要仅在IE浏览器中定位元素,我将使用
IE6:
* html #nav li ul {
left: -39px !important;
border: 1px solid red;
}
Run Code Online (Sandbox Code Playgroud)
IE7:
*+html #nav li ul {
left: -39px! important;
}
Run Code Online (Sandbox Code Playgroud)
有谁知道如何定位IE8?
可能重复:
如何在CSS中执行IE条件?
我如何才能将以下规则应用于IE?
.abc {
float:left;
height:0;
margin:0 10px;
width:0;
/*Apply these rules for IE only*/
position:absolute;
left:30;
top:-10;
/*Apply these rules for IE only*/
}
Run Code Online (Sandbox Code Playgroud) 朋友们,请帮我定义IE9的具体css规则?比如这样
/* IE 6 fix */
* html .twit-post .delete_note a { background-position-y: 2px; }
* html .twit-post .delete_note a:hover { background-position-y: -14px; }
Run Code Online (Sandbox Code Playgroud) 只是想知道这些IE黑客入侵我的技巧
"\9" - for IE8 and below.
"*" - for IE7 and below.
"_" - for IE6.
Run Code Online (Sandbox Code Playgroud)
即如
body {
border:2px solid blue;
border:2px solid yellow \9;
*border:2px solid green;
_border:2px solid orange;
}
Run Code Online (Sandbox Code Playgroud)
是否有人对IE9有这样的攻击?即我只是想通过CSS瞄准IE9?
由于IE在版本10中摆脱了条件评论,我迫切需要找到一个专门针对IE10的"CSS hack".请注意,它必须是被"黑客"而不是CSS属性的选择器.
在Mozilla中,您可以使用:
@-moz-document url-prefix() {
h1 {
color: red;
}
}
Run Code Online (Sandbox Code Playgroud)
在Webkit中,您通常会这样做:
@media screen and (-webkit-min-device-pixel-ratio:0) {
h1 {
color: blue;
}
}
Run Code Online (Sandbox Code Playgroud)
我如何在IE10中做类似的事情?
我有一个在其下面有ui-view的fieldset.
每个视图都有很多字段(字段是包装输入的指令).
它看起来像这样:
<fieldset ng-disabled='myCondition'>
<div ui-view></div> // this changes with lot's of fields that look like <div field='text-box'></div>
</fieldset>
Run Code Online (Sandbox Code Playgroud)
现在,这很好用,除IE之外的所有浏览器都禁用字段.
我做了一些谷歌,看到即不支持fieldset +禁用,我正在寻找一个快速的解决方法.
我尝试了一些接近但不完美的事情,我认为我不是第一个需要解决方案的人(即使我没有在谷歌上找到任何东西).
internet-explorer fieldset disabled-input angularjs angularjs-directive
css ×7
css-hack ×6
angularjs ×1
css3 ×1
fieldset ×1
html ×1
javascript ×1
stylesheet ×1
user-agent ×1
width ×1