HTML CSS examples for CSS Selector:element parent child
Exclude last two child elements with CSS selector
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> #parent>div:not(:nth-last-of-type(-n+2)) { border-bottom:2px solid Chartreuse; } </style> <!--from w ww . j a v a 2 s .c om--> </head> <body> <div id="parent"> <div> Lorem </div> <div> Lorem </div> <div> Lorem i </div> <div> Lorem </div> </div> </body> </html>