HTML CSS examples for CSS Widget:Div Border
Adding border for two divs side-by-side
<html> <head> <style> #a {<!--from ww w. j a v a 2 s. c o m--> border: 10px solid red; width: 200px; height: 200px; background: black; font-size: 0; } #a1 { font-size: 16px; border: 10px solid green; width: 100px; height: 200px; background: white; box-sizing: border-box; display: inline-block; float:left; } #a2 { font-size: 16px; border: 20px solid green; width: 100px; height: 200px; background: white; box-sizing: border-box; display: inline-block; float:left; } </style> </head> <body> <div id="a"> <div id="apadding"> <div id="a1"> a1 </div> <div id="a2"> a2 </div> </div> </div> </body> </html>