HTML CSS examples for CSS Widget:Table Cell
Add border to display:table-cell
<html lang="en"> <head> <title>Border vs Outline</title> <style> .bordered, .outlined {<!--from ww w . j a v a 2s.c o m--> display: table; margin: 1em; } .bordered div, .outlined div { display: table-cell; width: 100px; height: 100px; } .bordered .highlight { border: 10px solid orange; background: transparent; } .outlined .highlight { outline: 10px solid red; background: transparent; } .offset { outline-offset: -10px; } .bordered div, .outlined div { background: #CCC; } </style> </head> <body translate="no"> <div class="bordered"> <div></div> <div class="highlight"></div> <div></div> </div> <div class="outlined"> <div></div> <div class="highlight"></div> <div></div> </div> <div class="outlined"> <div></div> <div class="highlight offset"></div> <div></div> </div> </body> </html>