IE 8 and below not triggering click on elements which have display: none; Any workaround?

前端 未结 6 814
死守一世寂寞
死守一世寂寞 2021-02-12 22:07

The issue is with Internet Explorer 8 and below. Have found a decent working solution.

Issue

Internet Explorer 8 and below is no

6条回答
  •  天涯浪人
    2021-02-12 22:39

    Kind of crappy fix, but did the trick!

    Since it is because IE 8, which supports opacity, I had to use display: inline-block; with opacity: 0;.

    ul li label input {
        opacity: 0;
        width: 0px;
        height: 0px;
        display: inline-block;
        padding: 0;
        margin: 0;
        border: 0;
    }
    

    Now the input's box is hidden, literally. This fix is only for IE 8!

    Tried using the IE 8 Hack:

    ul li label input {
        opacity: 0\9;
        width: 0px\9;
        height: 0px\9;
        display: inline-block\9;
        padding: 0\9;
        margin: 0\9;
        border: 0\9;
    }
    

提交回复
热议问题