How to format code in html / css / js/ php
问题 I'm looking for a way to automatically format and color code I write in an HTML document. I know wikipedia does it, for example on the page: http://en.wikipedia.org/wiki/Nested_function I'm sure there are libraries out there to do this, but I can't for the life of me, find one. Does anyone have any suggestions? 回答1: Have a look at the Prettify JavaScript library. It's the one generally used by people (it's the one being used here on SO, for example.) You would use it like this: In your <head>