I recently encountered an issue where I center-aligned some text and positioned it using top:20%. Everything was working fine until I added a paragraph under it. At that point, the element moved back to its original position and the top:20% positioning didn't take effect.
<style>
.yes{
width : 100%;
height : 50%;
background-color: red;
text-align: center;
}
.yes a{
font-size : 300%;
position: relative;
top : 20%;
}
</style>
<div class = "yes">
<a>Title</a>
<p></p></div>
Update: Strangely, on jsfiddle, the div does not display as 50% in height which makes it difficult to see the issue I'm facing. Here is a link to view the code. If you remove the p tag, you will be able to observe the effect clearly: