Home >Web Front-end >HTML Tutorial >How to realize automatic color change of keywords in code

How to realize automatic color change of keywords in code

ringa_lee
ringa_leeOriginal
2018-05-14 14:28:342729browse

HTML CSS

Just like the display method in the CSDN forum, how to automatically change the color of the keywords of the code and display the line number? How is it implemented?

Example:

<html><head></head><body></body></html>


I checked the source code and used

标签,但是css代码是如何写的呢,怎样判断哪些词是代码中的关键词呢?我找了好久都没找到。知道答案的人能否告诉我一下。

to reply to the discussion (solution)

Google Highlight.js

Google Highlight.js
Thank you, I implemented it using SyntaxHighlighter!

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