HTML CSS examples for CSS Layout:Position
Css positioning during resizing container
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .MyBox {<!--from w ww. j a v a 2s . c o m--> padding:11px 11px; position:absolute; float:left; margin:11px 0px; border:6px solid Chartreuse; } .TopText { clear:right; } .MyText { float:left; margin:11px 11px; } .OtherText1 { clear:left; float:left; margin:11px 11px; } .OtherText2 { float:left; margin:11px 0px 11px 51px; } </style> </head> <body> <div class="MyBox"> <div class="TopText"> Lorem ipsum </div> <div class="MyText"> Lorem </div> <div class="MyText"> Lorem </div> <div class="MyText"> Lorem </div> <div class="MyText"> Lorem </div> <div class="MyText"> Lorem </div> <div class="OtherText1"> Lorem i </div> <div class="OtherText2"> Lorem i </div> </div> <div class="MyBox" style="top:150px"> <div class="AText"> Lorem ipsum </div> <div class="MyText"> Lorem </div> <div class="MyText"> Lorem </div> <div class="MyText"> Lorem </div> <div class="MyText"> Lorem </div> <div class="MyText"> Lorem </div> </div> </body> </html>