html - How to select li child of a ul without nth-child via css? -


i getting problem project our client has used logo image inside menu's ul li. has used class li logo placed cant use class it; not want use :nth-child because in future may add new menu element. have empty anchor inside logo li. possible in css select anchor empty. please me.

thanks in advance

client site: http://www.kangaroopartners.com/about/
my site: http://kangaroopartners-2.hs-sites.com/test1
demo http://jsfiddle.net/thwkav0e/

css , html:

ul {      display:block;      width:100%;      text-align:center;      list-style: none;      margin:0;      padding:0;  }    ul li {      display:inline-block;      padding: 10px;  }    ul li:nth-child(4), ul li:last-child {      background:red;      width:50px;  }
<ul>      <li><a href="#">hello1</a></li>      <li><a href="#">hello2</a></li>      <li><a href="#">hello3</a></li>      <li><a href="#"></a></li>      <li><a href="#">hello4</a></li>      <li><a href="#"></a></li>  </ul>

:empty selector should looking for.

ul li a:empty {     background:red;     width:50px;     display: inline-block;     height: 10px; } 

http://jsfiddle.net/thwkav0e/1/


Comments