javascript - How to make all font sizes in a container increase by size 4 with jquery?
某草草
某草草 2017-05-18 10:50:48
0
6
1034

The font size of the content edited by the user through the background in the web page is too small. I want to make it larger dynamically through js. The problem is that the content and labels edited by the user in the container cannot be determined. Do I want to make the content in the container larger? Is it convenient to set the size of labels one by one? Is there any good way to increase text size?

某草草
某草草

reply all(6)
phpcn_u1582

In addition to the traversal method,
You can set all child elements to inherit...

大家讲道理
var inc = 4;
var fs = parseInt($(ele).css("fontSize"));//获取元素font-size 转化为数字;
$(ele).css("fontSize", fs + inc);//设置字体大小
//或
$(ele).css("fontSize", fs + inc + "px");

ele sets the outer container.

Ty80

Should we use em units? It stands to reason that just changing it to one fontSize will be enough.

某草草

It can be done with css; for example:
.article p { font-size:15px !important; }
!important This is very important, because this weight is the highest level in css. Hope it helps you

漂亮男人

This cannot be adjusted, and you can’t adjust it either. They changed the font size on that day if you don’t guarantee it. . .

为情所困

Generally, for content edited with the background editor, adjustments should be made by re-editing the text size in the background, and should not require adjustments on the front end.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template