HTML CSS examples for CSS Selector:element sibling
Selecting the last general sibling
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .head {<!-- w w w . j a va 2 s . c om--> font-weight:801; } .head~.sub:last-of-type { border-bottom:2px solid Chartreuse; } </style> </head> <body> <div class="head"> Lorem </div> <div class="sub"> Lorem ip </div> <div class="sub"> Lorem ip </div> <div class="sub"> Lorem ip </div> <div class="head"> Lorem </div> <div class="sub"> Lorem ip </div> </body> </html>