adjust font size according container width

Solutions on MaxInterview for adjust font size according container width by the best coders in the world

showing results for - "adjust font size according container width"
Lena
18 Jul 2020
1/**
2 * You can automatically increase or decrease 
3 * the font size of the text in an element using CSS
4 */
5<p> Some text to automatically Adjust</p>
6
7<style>
8
9p {
10  font-size: 16px; /* The font size if container is too small */
11  font-size: 5vw; /* Font size adjustment in percent, if the container is larger and there is more room */
12}
13
14</style>