html - remove bullet in ul for only few items -


i have json similar to:

{ "qaset": [     {         "question": "question1",         "answer": [             "answer11",             "answer12"         ]     },     {         "question": "question2",         "answer": "answer2"     },     {         "question": "question1",         "answer": [             "answer31",             "answer32"         ]     } ] 

i have accordion, displays question part above , when individually clicked opens answer. using ng-repeat display questions , answers.

now, answers ng-repeat on ul, li tags. because of this, questions have 1 answer displayed against bullet. how rid of bullet such single answer entries (i.e. answer2 above).

li:only-child {     list-style: none } 

pure css.

edit @michael parker, you're right. pseudo-selector :only-child target element only-child of parent. while li targets li, :only-child restrict li child of parents.

note works only-child's li in all html. restrict, use

.any-class li:only-child {     list-style: none; } 

edit example of implementation can seen @ http://cdpn.io/e/bzaxkz


Comments