Toggle divs without using Javascript

后端 未结 11 2038
日久生厌
日久生厌 2020-12-06 10:19

I\'d like to toggle a

, but my requirement is that it must work with javascript turned off. I would like to select a hyperlink that sta
11条回答
  •  情歌与酒
    2020-12-06 10:51

    Here is the simple example follow this and you will be able to create toggle using css without any JAVASCRIPT and JQUERY. You can also add animations using css without JQUERY. CSS3 is AWESOME! :)

    .box{width:200px;
    height:0;
    background:red;
    transition:all 0.4s linear;}
    input:checked ~ .box{height:220px;}
    
    
    

提交回复
热议问题