JSFiddle - React, Tailwind, and code Playground

by Arsen

HTML

<div>first
<ul>
    <li>loool</li>
    <li>loool</li>
    

    
</ul>
</div>

<div> second
<ul>

    

    
</ul>

</div>

CSS

li:nth-of-type(1):nth-last-of-type(2),
 li:nth-of-type(2):nth-last-of-type(1){
     
    width: 50%;
    background-color: black;
}

li:only-of-type{
    
    width: 50%;
    background-color: black;

}