Js Rich text Editor Font size Settings

in a rich text editor implemented with js, the font size is set using the function:

document.execCommand("fontsize", false, fontsize);

but the function only accepts fontsize for font size parameters

.

currently want to achieve the effect in pixels, for example: 12px, 14px,

do not know how to achieve, would like to ask friends with experience, how to achieve this effect? Or try what?

Thank you!

Nov.23,2021

usually this is implemented through css with fontsize from 1 to 7. You can load your own css, to overwrite the fontsize of 1 / 7


does the landlord solve this problem


I also encounter this demand now, how does the landlord solve the problem

Menu