<!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>Two</span><span>Three</span> </span> <div>Four</div> <span class="notstart notend"></span> <div>Five</div> <span class="notstart notend"> <span>Six</span> </span> <div>Seven</div> <span class="notstart notend"></span> <div>Eight</div> <span class="notstart"> <span>Nine</span><span>Ten</span> </span> </body> </html>