Target IE9 or IE8 but not both using CSS

前端 未结 4 1863
旧巷少年郎
旧巷少年郎 2020-12-16 02:56

I know it shouldn\'t be done, but I just want a quick fix for now and that will give me time to find a proper fix for this.

How can I target IE8 alone using CSS bec

4条回答
  •  臣服心动
    2020-12-16 03:09

    This should work only in IE9 (and probably newer versions as well):

    :root #element-id {
      margin: 400px\9;
    }
    

    It is because :root pseudo class is not implemented in versions prior to IE9 (see http://msdn.microsoft.com/en-us/library/cc351024%28v=vs.85%29.aspx).

提交回复
热议问题