If you want to reuse this, you could put everything that makes it happen inside of a div using "posi<b></b>tion: relative" which would make the absolutely positioned stuff inside of it absolute within the confines of the outer div. In this case, you might consider using a CSS-styled horizontal rule &lt;hr&gt; tag to make that 1px black line.