KamCho KamCho - 1 year ago 109
CSS Question

CSS How to make text to scale like an image

I cannot figure out how to make text behave like image when resized. When I'm resizing browser text stays as large as on the beginning and starts to break in many rows. I tried to experiment with VW font-size but in that case, the text was too large on big screen and too small on small screen.

There are my css classes:

font-size: 35px;
font-size: 2.1875rem;
color: white;


I'll be thankful for any help with this.


Answer Source

I suspect that media queries is the only reasonable option here:

p {
  font-size: 5vw;

@media screen and (max-width: 600px) {
  p {
    font-size: 30px;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download