Hide Show content-list with only CSS, no javascript used

前端 未结 12 1557
长发绾君心
长发绾君心 2020-11-28 23:18

I\'ve been searching for a good trick to make a Hide/Show content or a list with only CSS and no javascript. I\'ve managed to make this action:



        
12条回答
  •  南方客
    南方客 (楼主)
    2020-11-29 00:04

    I've got another simple solution:

    HTML:

    Hide Me
    Show Me
    

    Some alarming information here

    CSS:

    body { display: block; }
    p.alert:target { display: none; }
    

    Source: http://css-tricks.com/off-canvas-menu-with-css-target/

提交回复
热议问题