HTML CSS examples for CSS Widget:Div
Placing a box between two sections
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .main {<!--from ww w. j a v a2s .c o m--> margin-top:100px; } .hover2 { height: 50px; width: 100px; background: green; margin-left:180px; position: absolute; margin-top:60px; } .container1, .container2, .container3 { float: left; } .container0 { background: purple; width: 100%; height:100px } .class1 { background: red; height:100px; width:100px; border-radius:50px; margin-left: 40px; } .class2 { background: yellow; height:100px; width:100px; border-radius:50px; margin-left: 40px; } .class3 { background: blue; height:100px; width:100px; border-radius:50px; margin-left: 40px; } </style> </head> <body> <div class="main"> <div class="container0"> <div class="hover2"></div> </div> <div class="container1"> <div class="class1"></div> </div> <div class="container2"> <div class="class2"></div> </div> <div class="container3"> <div class="class3"></div> </div> </div> </body> </html>