IE5 max-width support & posible solution

有些话、适合烂在心里 提交于 2019-12-12 03:11:51

问题


I simply wanna set a max and a min width to my content in my IE5 compatible site i read out of this site that the solution below could solve it, in this following example i only show max width.

But there must be some issue cause it don't work can somebody tell me what is wrong? or another solution - it can have a javascript solution - but i need to be IE5 supported?

* html .wrapper { 
   width: expression( document.body.clientWidth > 960 ? "961px" : "auto" ); /* sets max-width for IE */
}
html .wrapper{
  max-width: 960px;
}
  • A footnote i compile it with compass cause its a s Sass project (it dosn't fail in the build step)

回答1:


If found out what made it bug

it seems that IE5 for some odd reason ignore the expression if your normal statement isn't width and not max-width see solution below

* html .wrapper { 
   width: expression( document.body.clientWidth > 960 ? "961px" : "auto" ); /* sets max-width for IE */
}
html .wrapper{
  width: 960px;
}
html.gtie7 .wrapper{
  max-width: 960px;
  width: auto;
}

hope it was useful if anybody some day should run into the same problem



来源:https://stackoverflow.com/questions/18075165/ie5-max-width-support-posible-solution

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!