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.
Also I would like to know if there is a way to have
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
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.
Thanks
回答你的第一个问题:包括在IE样式表文件只,换你<link>
与条件注释荷兰国际集团。 下面是关于如何做到这一点的例子:
<!--[if IE]>
<link rel = "stylesheet" type = "text/css" href = "cssfile.css" />
<![endif]-->
回答你的第二个问题,旧版本的IE不支持border-radius
。 IE9不支持它,但。 有没有其他的解决方法,而不是使用图片或第三方插件,像jQuery的角落 。
Internet Explorer 9的和更高版本支持边界半径。 较低的版本不支持这一点。 您可以
- 使用图片
- 忽略Internet Explorer 8和下面
- 使用jQuery插件http://jquery.malsup.com/corner/
您正在寻找有条件的样式与CSS黑客和一个我不得不从最底层挖出: PIE CSS3装饰品IEXPLORER 。
IE特定的CSS:
使用Modernizr的,以确定哪些功能是在用户的浏览器。 这将增加类的<body>
标记,然后你就可以在你的样式表中引用,以激活某些风格,如果一个给定的功能或者是不存在的。
使用条件注释包括IE特定的样式表。
使用IE CSS破解,喜欢这里所描述的: http://net.tutsplus.com/tutorials/html-css-techniques/quick-tip-how-to-target-ie6-ie7-and-ie8-uniquely-与-4-字符/
边框半径:
这是通过IE9支持,所以您必须使用IE8或之前(或兼容模式)。
忽略它老年人的IE用途。 这是不值得的努力来支持他们的功能,实际上并不影响网站的可用性。
使用CSS3Pie在破解border-radius
功能为IE。 这是一个黑客,但它工作得非常好(比正在这里推荐一些其他)。