Edit This Code:
See Result »
<!DOCTYPE html> <html> <head> <style> body { margin: 0; padding: 0; } .container { position: relative; width: 100%; } .right { position: absolute; right: 0px; width: 300px; background-color: #b0e0e6; } </style> </head> <body> <div class="container"> <div class="right"> <p><b>Note: </b>When aligning using the position property, always include the !DOCTYPE declaration! If missing, it can produce strange results in IE browsers.</p> </div> </div> </body> <!-- Mirrored from www.w3schools.com/css/tryit.asp?filename=trycss_align_pos_crossbrowser by HTTrack Website Copier/3.x [XR&CO'2014], Sun, 13 Mar 2016 11:02:57 GMT --> </html>
Result: