I was wondering if there was a tag that auto-highlights the syntax of HTML and or PHP in HTML5. I'm writing a guide that has some code in it. Since I'm using a lot of the new html5 tags (I use section for the outline of my guide) I would like to use something in native html5.
If this does not exist, what is the best way to do this? (Like, PHP and CSS?)
There's nothing like that in HTML5 I am afraid, but you can always use highlight_string()
from PHP. If you want something purely on the client side, try a JS highlighter like prettify, which is what StackOverflow uses for their code highlighting:
http://code.google.com/p/google-code-prettify/
Here are some other ones:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With