Creating an Editable Textarea That Supports Syntax-Highlighted Code | CSS-Tricks
When I was working on a project that needed an editor component for source code, I really wanted a way to have that editor highlight the syntax its typed.
css-tricks.com