Make a whole div clickable with working :active css rule in IE10

前端 未结 5 508
抹茶落季
抹茶落季 2021-01-04 00:46

I\'m designing a clickable panel for an html app which contains multiple text elements and images.

From what I understand this is generally done with a div. Somethin

5条回答
  •  無奈伤痛
    2021-01-04 01:37

    I overlay the the element using :after so that children are not clickable.

    .myButton:after {
        content: '';
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: #fff;
        opacity: 0;
        filter: alpha(opacity=0);
    } 
    

提交回复
热议问题