views:

50

answers:

4

What is the best way to increase and decrease text size on a web page using PHP, CSS, or JQuery? And is there any tutorials on how to do this? or an example would be helpful.

Thanks

A: 

Set text-size on the text container (a p, a div, a span, ...).

<p style='font-size:120%'>
Palantir
`text-size`? is this a new css style?
Reigel
A: 

See:

Text Resizing With jQuery

Here is the DEMO

Sarfraz
A: 

Check the font-size CSS property

Reference: http://www.w3.org/TR/CSS2/fonts.html#font-size-props

Gaby
+3  A: 

You can increase text size on the whole page (for all elements that inherit text size from the 'body') with:

function setFontSize(size) {
    $('body').css('font-size', '' + size + 'px');
}

Demo here.

sje397