仅为Internet Explorer创建CSS [英] Create CSS for Internet Explorer Only

查看:115
本文介绍了仅为Internet Explorer创建CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我花了很多时间使网站看起来不错,使用谷歌浏览器和Firefox,但是,通常情况下,当我在Internet Explorer中查看它,它看起来比起它开始时更糟。我相信有一种方法有一个IE只有CSS文件,但我不记得如何做到。

I spent a good amount of time making a website look good, working with Google Chrome and Firefox, however as is often the case, when I look at it in Internet Explorer it looks worse than it did at the start. I believe there is a way to have an IE only css file, however I don't recall how to do it. Can you point me in the right direction.

我想知道是否有办法

-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;

适用于IE。我看了这几年前,我认为唯一的选择是,有图像创建半径。希望有一些新的工作(更简单越好)。

work for IE. I looked into this years ago and I think the only option then was to have images create the radius. Hopefully there is something new that works (the simpler the better). The border radius is just one of the many things that render differently now that I changed the css.

感谢

推荐答案

回答您的第一个问题:在IE中包含样式表文件,将< link>

Answer to your first question: to include a stylesheet file in IE only, wrap your <link>ing with a conditional comment. Here's an example on how to do it:

<!--[if IE]>
    <link rel = "stylesheet" type = "text/css" href = "cssfile.css" />
<![endif]-->

回答您的第二个问题旧版IE不支持 border-radius 。 IE9支持它,虽然。除了使用 jQuery角等图片或第三方插件,除此之外没有解决方法。

Answer to your second question older versions of IE do not support border-radius. IE9 does support it, though. There's no workaround other than to use images or third-party plugins like jQuery corner.

这篇关于仅为Internet Explorer创建CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆