How do I select the first adjacent sibling?

前端 未结 8 2274
北海茫月
北海茫月 2020-12-30 19:38

I have an HTML list like so:

  • Heading 1
8条回答
  •  失恋的感觉
    2020-12-30 20:39

    try using JS to getElementsby Classname and if more than 1 then use CSS:

    ul li:first-child {display: none;}
    

提交回复
热议问题