I want to allow the user to change the font-size
of the entire webpage.
I have set the font-size in rem and I am trying to change the font-size of the root so that it reflects for all the elements.
My markup-
<body >
<div id="test-text">
ALL TEXT
</div>
<p>sample text</p>
<p>sample text2</p>
<span>sample text3</span>
<h1>tst4</h1>
<label>label</label>
<button id="inc">inc</button>
</body>
CODE-
$('#inc').click(function(){
$('body').css('font-size','4rem !important');
})
CSS-
p{
font-size: 2rem;
}
span{
font-size: 0.5rem;
}
The code is not reflecting anything. What am I missing here?