When working with text in HTML, I encountered an issue where using percentages for width and height was not giving me the desired results. To work around this, I used images of text instead, but each image ended up either stretched or looking too small.
Here is the code I am currently using:
<img class="LohaD" src="./Styles/img/LohaD.png" />
.LohaD {
width: 78.2%;
height: 2.4%;
object-fit: contain;
text-align: center;
display: block;
vertical-align: central;
margin-left: auto;
margin-right: auto;
}
The main drawback of this approach is that I cannot maintain the text size consistently across different devices when using images. I am hopeful for some suggestions on how to achieve responsive text with percentage-based sizing. Thank you.