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?
phpcn_u15822017-05-18 10:52:48
In addition to the traversal method,
You can set all child elements to inherit...
大家讲道理2017-05-18 10:52:48
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.
PHP中文网2017-05-18 10:52:48
Should we use em units? It stands to reason that just changing it to one fontSize
will be enough.
某草草2017-05-18 10:52:48
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
漂亮男人2017-05-18 10:52:48
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. . .
为情所困2017-05-18 10:52:48
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.