HTML CSS examples for CSS Layout:Position
Basic CSS positioning stack
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .box {<!--from w w w . j ava 2s. co m--> width:401px; height:201px; position:relative; } #up { background:red; } #middle { margin-top:-51px; background:green; } #down { background:blue; } </style> </head> <body> <div class="box" id="up"></div> <div class="box" id="middle"></div> <div class="box" id="down"></div> </body> </html>