Default :target with CSS

后端 未结 5 474
深忆病人
深忆病人 2020-11-29 08:42

I have this CSS:


And this HTML:<

5条回答
  •  眼角桃花
    2020-11-29 09:14

    Spontaneously I'd have to say that the only solution I can think of is unfortunately using JavaScript. Something like:

    
    

    EDIT:

    Ok, got a CSS solution. This however requires the default entry #updates-list to be placed last (after #updates-map and any other tabs you may add):

    .tab, .tab:target ~ #updates-list  {
      display: none;
    }
    #updates-list, .tab:target {
      display: block;
    }
    

提交回复
热议问题