开发者

How to increase and decrease text size in web page? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 7 years ago.

开发者_如何学运维 Improve this question

How do I increase and decrease text size on a web page using PHP, CSS, or JQuery?


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.


Check the font-size CSS property

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


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

<p style='font-size:120%'>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜