0

I have a <span> element including a long text. The span has a font-size set on its css stype. The text will be overflowed or wrapped if it is too long. I wonder whether there is a css style to make the text fit into the width of the span without wrapping. I want the css style to disable the font-size on the span and automatically apply a new font-size to fix the content.

Joey Yi Zhao
  • 37,514
  • 71
  • 268
  • 523

1 Answers1

0

Not sure if that's the case, but if your <span>'s width is dependent on the width or height of the viewport, you can use vw or vh CSS units. MDN Docs

Mendy
  • 7,612
  • 5
  • 28
  • 42