Without the rest of the code it's hard to make sure this answer will suit you. But what I can say is that position:absolute
with left:35%
is not the ideal way, so it's hardly going to stay aligned on all the screens.
To align the text in 90% of cases, only a text-align:center
will solve.
Example one with text-align:center
body {
font-family: sans-serif;
}
#h1{
color:#3396ff;
top: 70px;
text-align:center;
}
#p{
top: 140px;
text-align:center;
font-weight:bold;
}
<h1 id="h1">Meu título aqui</h1>
<p id="p">Meu paragrafo aqui</p>
If the answer does not solve your problem leave a comment I can help you. But then I need you to edit your code with the complete code so I can give you a more accurate answer.