<!DOCTYPE html> <html> <head> <style> body > span { border: 3px solid blue } .notstart { border-left: none; } .notend { border-right: none; } </style> </head> <body> <span class="notend"> <span>One</span> </span> <div>Two</div> <span class="notstart notend"> <span>Three</span> </span> <div>Four</div> <span class="notstart"> <span>Five</span> </span> </body> </html>