It looks like a little jQuery is necessary. Check out this answer on a similar question: Is it possible to dynamically scale text size based on browser width?
Set type size in relation to parent's width
-
30-06-2022 - |
Вопрос
I'm creating a website with a design which aims to fill the screen. As a result the elements' dimensions are percentage based.
I have a sidebar with a width of 30%
of the browser window (I've set this with css)
Now I want the text to fit in this sidebar, and be as large as possible.
How do I make the the font size dependent on the sidebar's width? Is this possible with only CSS, or would I need to use jQuery?
Let me know if you need any more info, thanks for your help already!
Решение
Не связан с StackOverflow