我正在使用响应式网站。我已经使用媒体查询来做出责任。基本上,我没有使用任何固定的宽度。我使用百分比作为每个div的宽度。如何在其他默认样式的样式表中为IE编写CSS
因此,网站可以根据浏览器的大小调整比例。对于较宽的使用百分比可能会导致较旧的ie问题。因为即在9之前不支持媒体查询,所以,我想为那些ie构建不可伸缩版本。由于我只提供了几个提高可伸缩性的代码,因此,如果我在我的主样式表下使用默认CSS在/在任何位置编写CSS代码,那么可以吗?
像在style.css
:
#info {
width: 13.672%;
/*if ie9 and lower
width: 175px;*/
height: 830px;
/*if ie9 and lower
margin-right: 40px;*/
margin-right: 3.125%;
float: left;
}
img {
margin: 0px;
padding: 0px;
border: 0px;
max-width: 100%;
/*if ie9 and lower
max-width: inherit*/
height: auto;
/*if ie9 and lower
height: inherit*/
}
我想写格式。但是,我不知道正确的格式。请告诉我正确的格式。
给你的另一个问题。由于这些版本的,即不支持媒体查询,所以meta标签
<meta name="viewport" content="width=device-width, maximum-scale=1.0, minimum-scale=1.0, initial-scale=1.0" />
<link href="KT2012.css" rel="stylesheet" type="text/css" />
<link href="kt_large.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" media="only screen and (min-width:50px) and (max-width:500px)" href="kt_small.css" />
<link rel="stylesheet" type="text/css" media="only screen and (min-width:501px) and (max-width:800px)" href="kt_tablet.css" />
<link rel="stylesheet" type="text/css" media="only screen and (min-width:801px) and (max-width:1024px)" href="kt_medium.css" />
与tablet.css
,mobile.css
不要为那些旧版本即任何问题,不是吗?我的意思是我只想在我的主样式表(KT2012.css
)上编写IE特殊的CSS。我是否应该在每个样式表中编写每个IE特殊的CSS,例如mobile.css
,tablet.css
等?如果设计的基于CSS的文件不支持旧的ie,那么,如果我为ie制作了不可扩展的版本,那么我不会对那些基于设备/视口的样式表做任何事情,不是吗?
只是为了澄清一下:你是否想把IE9包含在这个或不是? (你在问题文本中说你希望它在“IE9之前”工作,但在代码注释中放入了“IE9和更低版本”)。 – Spudley
我想为IE6,IE7,IE8,IE9制作不可扩展的版本。 这是网站:http://abidhasan.zxq.net/KrisTobiassen2012 看到,它根据浏览器的大小调整正确/按比例调整。我不想在更老的ie。因为使用百分比作为宽度,老年人即显示的那个问题:http:// imgur。换句话说,我想关闭较老的ie的响应特殊代码(即1-9) – user1896653