I center-aligned some text and then positioned it using top:20%. It worked fine, but when I added a paragraph under it, the element just moved back into the beginning position(the top:20% 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>
Aucun commentaire:
Enregistrer un commentaire