HTML CSS examples for CSS Layout:Text
Layout text to left and right in its container
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> #grey_box {<!-- w ww . j a v a 2 s .c o m--> height: 80px; background: #f4f4f4; width: 900px; margin: 0 0 20px 20px; } .text { float: left; width: 450px; } .buttons { float: right; margin-right: 20px; width: 350px; padding:20px; text-align:right; } </style> </head> <body> <div id="grey_box"> <p class="text">some text</p> <div class="buttons"> <a class="button1">button 1</a> <a class="button2">button 2</a> </div> </div> </body> </html>