Home  >  Article  >  Web Front-end  >  How to display web code on a static page and highlight it like this_html/css_WEB-ITnose

How to display web code on a static page and highlight it like this_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:12:511543browse


Thank you, please give me some advice. The color of each block of the displayed code is different, and the color of the highlight is different for different codes.


Reply to the discussion (solution)

css first defines all the keyword styles for reference.
When the user selects it, it will be displayed. Use js to judge. If the code includes content in the definition, highlight

code highlighting plug-in?

http://paranimage.com/6-javascript-code-highlighting-plugins/

This can be achieved with JS or JQ

Are you a blogger? Or a website? For blogs, you can find plug-ins, and for websites, use JS. .

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn