HTML CSS examples for CSS Layout:Box
move up an inner box and keep outer box in place with CSS
<html> <head> <style> #yellow {<!-- w ww . ja v a2 s . com--> height:100px; background:yellow; } #blue { background:blue; } #red { background:red; width:401px; height:100px; margin:0px auto; position:relative; top:-31px; } </style> </head> <body> <div id="yellow"></div> <div id="blue"> <div id="red"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper </div> </div> </body> </html>