Below is my html structure
Try to use something like that:
.footerMenu li {background-color: expression(this.previousSibling==null?'red':'green');}