1
Without the rest of the code it is difficult to be sure that this answer will suit you. But what I can say is that position:absolute
with left:35%
is not the ideal way, the way it is will hardly be aligned on all screens.
To align text in 90% of cases only one 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 that I can help you. But then I’ll need you to edit your code with the full code so I can give you a more accurate answer.
Look about media queries, the percentage measure does not help much, because it is the percentage of pixels and not the actual screen size. https://www.w3schools.com/css/css3_mediaqueries_ex.asp
– Sveen
Diana there are some styles in your CSS that are seemingly unnecessary, see the details in my reply. But if you do not answer I will ask you to edit your answer with the full code so I can give you an accurate answer.
– hugocsl