Bart
Bart

Reputation: 4920

how to set a bigger font size using jquery for the whole page?

how to set a bigger font size using jquery for the whole page?

Upvotes: 1

Views: 332

Answers (2)

mpdonadio
mpdonadio

Reputation: 2941

I typically do something like


var $scale = $("<div>").attr("id", "scale").css("font-size", "120%");
$("body").wrapInner($scale);

as this give a little more control than directly altering body and allows you to revert back to the original size a bit easier. You can also extend this with classes and CSS definitions for switching between different sizes pretty easily.

Upvotes: 0

Nick Craver
Nick Craver

Reputation: 630409

It's not fool-proof and for all scenarios, but as close as you could get (without getting much more complicated) would be setting the font-size or zoom, like this:

$("body").css("font-size", "2em");
//or:
$("body").css("zoom", "2");

Upvotes: 1

Related Questions