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

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

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -