html div with text on top and bottom -


i need create <div> of height 200px has text @ top , bottom. needs work in major browsers. i've tried various combinations of alignment/vertical-alignment no luck.

use 2 spans (or whatever) inside div:

<div>      <span id="top">text @ top</span>      <span id="bottom">text @ bottom</span> </div> 

then give div position: relative; , position spans absolutely:

div {     position: relative;     height: 200px; }  span {     position: absolute; }  span#top {     top: 0; }  span#bottom {     bottom: 0; } 

live example:

http://jsbin.com/ucowi3


Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -