 <p>Just add position: relative; to each of the styles, as stated here: <a href="http://www.w3schools.com/cssref/pr_pos_z-index.asp" rel="nofollow">http://www.w3schools.com/cssref/pr_pos_z-index.asp</a></p> <p>(They can both have relative positioning)</p>