How Do Rich Text Editors In Html Documents Achieve Their Rich Text Formatting?
Solution 1:
I think the answer is that what you're looking at is typically NOT an actual <textarea>
. It's a <div>
or <span>
made to look like a text area. A regular HTML textarea doesn't have individual formatting of the text.
"Rich-Text editors" will have controls that modify the contents of the span/div with regular html markup (<strong>
, <em>
, etc.) to emulate a full-blown rich text editor
Solution 2:
Usually, the rich text editor will provide a variable to specify a style sheet in. That style sheet will then be loaded and applied to the textarea (Most, if not all, rich text editors use a IFRAME to display the editor in, and obviously styles specified in the main document won't apply to it.)
Solution 3:
It's a textarea
when you send the HTML to the user but the editor replaced it with a div
when it can start.
This way, the code gracefully degrades: Users with unsupported web browsers or disabled JavaScript can still edit the text in the textarea
while all the other users get a nice rich text editor.
Solution 4:
Basically, the TEXTAREA contents are used as the HTML source for the IFRAME.
Post a Comment for "How Do Rich Text Editors In Html Documents Achieve Their Rich Text Formatting?"