Use CSS to hide contents on print

后端 未结 5 1661
萌比男神i
萌比男神i 2020-12-15 09:07

I’m looking for an easy way to hide everything except a certain div and its contents.


  
  
    
5条回答
  •  伪装坚强ぢ
    2020-12-15 09:36

    Depending on your HTML structure (and browsers you need to support, because IE6 won't support this), you could hide all top-level divs and just show the one/few you want to show:

    body > div {
       display: none;
    }
    
    #content {
      display: block;
    }
    

提交回复
热议问题