I have a list of elements, which are styled like this:
Every things seems correct. You might want to use the following css selector instead of what you used.
ul > li:not(:last-child):after