JSFiddle - React, Tailwind, and code Playground

by Guruprasad Rao

HTML

<div id="container"><span>This is my text</span></div>

CSS

* {
    font-family:Myriad Pro;
    
}

#container {
    height:100px;
    width:98%;
    background-color:#eeeeee;
    padding:1%;
}

JavaScript

function changeSize(){
 	var fontSize = parseInt($("#container").width()/4)+"px";
    $("#container span").css('font-size', fontSize);   
}

$(document).ready(function() {
    changeSize();
    $(window).resize(changeSize);
});