css - Placing text in div -


at top of page have header (div) few px distance top of page. in div got page title , placing in top left corner (wich normal). down @ bottom of div (still @ right). html:

<body>     <div id="header">         <h1>x</h1>     </div> </body> 

and css:

#header {     width: 700px;     height: 200px;     margin-left: auto;     margin-right: auto;     background-color: #ffffff;     color: #cdffaf;     font-size: 30px; }  h1 { margin-top: 5px;     } 

you can use display: table-cell vertical-align: bottom;

demo

color changed (for visibility)


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -