How to hide an anchor tag by href #id using css

后端 未结 6 2272
刺人心
刺人心 2021-02-14 06:08

I have different anchor tags with href=#ids and I need to hide them using a general css rule for all of them,

Content xxxxxxxxx Table 1&         


        
6条回答
  •  故里飘歌
    2021-02-14 06:35

    Assuming #wrap is an id of a parent, you can use:

    /* Hide all anchor tags which are children of #wrap */
    #wrap a{ display:none; }
    
    /* Hide all anchor tags which are direct children of #wrap */
    #wrap > a{ display:none; }
    
    /* Hide a specific anchor tag (Probably won't work in IE6 though) */
    a[href="#tab1"]{ display:none; }
    

提交回复
热议问题