I tried bunch of options for changing font depends of div width but I didn't find a solution.
So I want to font of h2 automatically be changed when I change div width.
So can someone help me how to fix this.
I create the h2
var h2 = document.createElement('h2');
h2.innerHTML= "GET AN ESTIMATE OVER VIDEO CHAT";
h2.setAttribute("class", "naslov");
Then I insert it into div:
div2.appendChild(h2) + "\n";
And then I tried to change font size using css. So I tried next options:
h2{
font-size: 80%;
font-size: 1vw;
font-size: 1vh;
// and few more options
}
So can someone help me? Can I do it with css, or I should use JavaScript?