0

I can't find any reference on how to do adjustable font-size depending on screen-width and its content? Tried the following code below but it doesn't work when content change it only works in dynamic screen-width.

<div class="sample">
  <span>Sample</span>
  <span>Sample Sample Sample</span>
  <span>Added Added</span>
</div>

.sample {
  height: 50px;
  width: 320px;
  border: 1px solid black;
  font-size: 6vw;
}

Expected output should be. enter image description here

But the current code looks like below: enter image description here

schutte
  • 1,455
  • 5
  • 18
  • 33

0 Answers0