how to set css if there is last div then last span should be none code example Example: selecting last child css p:last-child { font-size: 0.75em; }