on click hide this (button link) pure css

前端 未结 3 1895
感情败类
感情败类 2020-12-10 23:28

my function is hide and show div with pure css but when i click open, the button still not disappear.



        
3条回答
  •  不知归路
    2020-12-10 23:35

    Mr_Green Thank you for that code. I modified it for a responsive expanding menu on mobile devices

    HTML

    
    
    
    Some Content

    CSS

    @media (max-width: 650px) {
    
    input.checkbox-toggle + label {
        display: block;
        padding:.7em 0;
        width:100%;
        background:#bbbbbb;
        cursor: pointer;
        text-align:center;
        color:white;
        Text-transform:uppercase;
        font-family:helvetica, san serif;
        }
    
    input.checkbox-toggle:checked + label {
        background:#6a6a6a;
        }
    
    #show {
        display: none;
        }
    
    input.checkbox-toggle:checked ~ #show {
        display: block;
        }
    
    }
    
    input.checkbox-toggle {
        display: none;
        }
    

提交回复
热议问题