针对特定浏览器创建布局 [英] Creating layout for a specific browser
问题描述
我有一个asp.net-MVC3网站。
我使用CSS创建的所有布局。布局正是我多么希望它在Firefox和Chrome,但在Internet Explorer上它是在一个很大的混乱。
I have an asp.net-mvc3 website. I created all the layout using css. The layout is exactly how I want it on firefox and Chrome, but on internet explorer it is in a big mess.
所以,现在我试图修复它。
So now i am trying to fix it.
但问题是,我想解决它不搞乱它Firefox或Chrome。
But the problem is that I want to fix it without messing it on firefox or chrome.
我必须从头开始重新启动并重新布局?或者是有指定一定的布局特定的浏览器的方法。
Do I have to restart from scratch and rebuild the layout? or is there a way to specify a certain layout for a specific browser.
事情是这样的:
如果Internet Explorer然后使用这个CSS表或样式,否则用什么,我有媒体链接
If Internet Explorer then use this css sheet or style, else use what I allready have.
推荐答案
使用这些(把它的头):
use these(put it on the head):
目标IE浏览器的所有版本
Target ALL VERSIONS of IE
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="all-ie-only.css" />
<![endif]-->
目标一切,除了IE
<!--[if !IE]><!-->
<link rel="stylesheet" type="text/css" href="not-ie.css" />
<!--<![endif]-->
目标IE 7 ONLY
Target IE 7 ONLY
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="ie7.css">
<![endif]-->
目标IE 6只
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="ie6.css" />
<![endif]-->
目标IE 5只
<!--[if IE 5]>
<link rel="stylesheet" type="text/css" href="ie5.css" />
<![endif]-->
目标IE 5.5 ONLY
Target IE 5.5 ONLY
<!--[if IE 5.5000]>
<link rel="stylesheet" type="text/css" href="ie55.css" />
<![endif]-->
目标IE 6和LOWER
Target IE 6 and LOWER
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="ie6-and-down.css" />
<![endif]-->
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="ie6-and-down.css" />
<![endif]-->
目标IE 7和LOWER
Target IE 7 and LOWER
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" href="ie7-and-down.css" />
<![endif]-->
<!--[if lte IE 7]>
<link rel="stylesheet" type="text/css" href="ie7-and-down.css" />
<![endif]-->
目标IE 8和LOWER
Target IE 8 and LOWER
<!--[if lt IE 9]>
<link rel="stylesheet" type="text/css" href="ie8-and-down.css" />
<![endif]-->
<!--[if lte IE 8]>
<link rel="stylesheet" type="text/css" href="ie8-and-down.css" />
<![endif]-->
目标IE 6和更高
<!--[if gt IE 5.5]>
<link rel="stylesheet" type="text/css" href="ie6-and-up.css" />
<![endif]-->
<!--[if gte IE 6]>
<link rel="stylesheet" type="text/css" href="ie6-and-up.css" />
<![endif]-->
目标IE 7和更高
<!--[if gt IE 6]>
<link rel="stylesheet" type="text/css" href="ie7-and-up.css" />
<![endif]-->
<!--[if gte IE 7]>
<link rel="stylesheet" type="text/css" href="ie7-and-up.css" />
<![endif]-->
目标IE 8或更高
<!--[if gt IE 7]>
<link rel="stylesheet" type="text/css" href="ie8-and-up.css" />
<![endif]-->
<!--[if gte IE 8]>
<link rel="stylesheet" type="text/css" href="ie8-and-up.css" />
<![endif]-->
这篇关于针对特定浏览器创建布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!