HTML CSS examples for CSS Widget:Div Border
Nested divs with overlapping borders
<html> <head> <style> .tags-container {<!-- ww w.j av a 2s.c o m--> border: 1px solid red; } .tag { float: left; margin-top: -1px; margin-left: -1px; padding: 5px; border: 1px solid #ff0000; } .tags-container div:last-child { margin-bottom: -1px; } </style> </head> <body> <div class="tags-container"> <div class="tag"> Pizza </div> <div class="tag"> Spaghetti </div> <div class="tag"> Mandolino </div> <div class="tag"> Pizza </div> <div class="tag"> Spaghetti </div> <div class="tag"> Mandolino </div> <div style="clear: both"></div> </div> </body> </html>