css - css3 last-child not working as expected -


I have a matching list dynamically, after each member, I will display one which VS . Presents. However, the final match should not be seen in the final match. Any ideas how can I do this? HTML

  & lt; Style & gt; .similarity {}. Mak ul} Make Ul Lee {float: left; Margin-right: 50px; } .match ul li: last-child {performance: none; } & Lt; / Style & gt; & Lt; Div class = "content" & gt; & Lt; Div class = "match" & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; A href = "/ wade-barrett / member" & gt; Wade Barrett & lt; / A & gt; & Lt; / Li & gt; & Lt; Li style = "" & gt; VS & lt; / Li & gt; & Lt; / Ul & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; A href = "/ shaemus / member" & gt; Shamas & lt; / A & gt; & Lt; / Li & gt; & Lt; Li style = "" & gt; VS & lt; / Li & gt; & Lt; / Ul & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; A href = "/ randy-orton / member" & gt; Randy Orton & lt; / A & gt; & Lt; / Li & gt; & Lt; Li style = "" & gt; VS & lt; / Li & gt; & Lt; / Ul & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; A href = "/ John-Cena / Member" & gt; John Cena & lt; / A & gt; & Lt; / Li & gt; & Lt; Li style = "" & gt; VS & lt; / Li & gt; & Lt; / Ul & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; A href = "/ side / member" & gt; Edge & lt; / A & gt; & Lt; / Li & gt; & Lt; Li style = "" & gt; VS & lt; / Li & gt; & Lt; / Ul & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; A href = "/ Chris-JerryCo / Member" & gt; Chris Jericho & lt; / A & gt; & Lt; / Li & gt; & Lt; Li style = "" & gt; VS & lt; / Li & gt; & Lt; / Ul & gt; & Lt; P class = "clear" & gt; & Lt; / P & gt; & Lt; / Div & gt; & Lt; / Div & gt;  

: last-child implementing a pretend class For ul , li no, because you have hidden VS of last ul in the list. In applying a pseudo-class in li , you << strong> every ul code> , which That's wrong.

You should also apply a class attribute for li elements with VS text so that it

change

  & lt; Li style = "" & gt; VS & lt; / Li & gt;  

to

  & lt; Li class = "vs" & gt; VS & lt; / Li & gt;  

and use it instead of your current : last-child selector:

 . Match: Take the last child Vs {display: none; }  

Comments