<分区>
<分区>
我的 SharePoint Web 应用程序中有以下左侧导航菜单:-
现在我想隐藏 Div 中的前两个表(命名为;文档和图像),我尝试了以下但它只删除了“文档”表:-
#ctl00_PlaceHolderLeftNavBar_ctl02_WebTreeView > table:first-child { display: none !important;}
有人可以就此提出建议吗?
最佳答案
使用:nth-child(n)
选择器,其中n
是元素在容器中的位置索引,所以:
#ctl00_PlaceHolderLeftNavBar_ctl02_WebTreeView > table:nth-child(1),
#ctl00_PlaceHolderLeftNavBar_ctl02_WebTreeView > table:nth-child(2) {
...
}
关于html - 如何将前两个表隐藏在一个div中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27234570/