Home >Web Front-end >HTML Tutorial >How is the csdn code effect achieved? _html/css_WEB-ITnose

How is the csdn code effect achieved? _html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:25:121030browse

<html><head>    ...</head><body>    ...</body></html>
像这样的效果是怎么做到的,用了什么?


回复讨论(解决方案)

我想做整个的代码框功能

 

http://bbs.csdn.net/assets/sh-e7799bf9690a86571a685dd3015e559c.js

这个js实现的语法高亮

http://bbs.csdn.net/assets/sh-e7799bf9690a86571a685dd3015e559c.js

这个js实现的语法高亮 这代码好乱啊。。。。

压缩过了。。插件名称是SyntaxHighlighter,楼主找找这个插件的API看看

http://alexgorbatchev.com/SyntaxHighlighter/manual/installation.html

http://alexgorbatchev.com/SyntaxHighlighter/manual/installation.html

<pre class="brush: html;"><html>	<head>		...	</head>	<body>		...	</body></html>
这样写的效果就是空白和...,标签都成效果了,不以字符形式显示。我加了43e1fc467495bab219a3286f74139f6ac4d9033ad21c358430e75a24655d3d0f后,结果43e1fc467495bab219a3286f74139f6ac4d9033ad21c358430e75a24655d3d0f这两个也显示出来了,让标签以字符形式显示出来呢?

要将a8093152e673feb7aba1828c43532094替换为实体<>

要将a8093152e673feb7aba1828c43532094替换为实体<> 那csdn是怎么做到我输入a8093152e673feb7aba1828c43532094就显示a8093152e673feb7aba1828c43532094的呢?

楼主去了解下说明是html实体,csdn已经将a8093152e673feb7aba1828c43532094替换为<>了,之中显示出来就是a8093152e673feb7aba1828c43532094,要是源代码包含a8093152e673feb7aba1828c43532094,就不会显示了

楼主去了解下说明是html实体,csdn已经将a8093152e673feb7aba1828c43532094替换为<>了,之中显示出来就是a8093152e673feb7aba1828c43532094,要是源代码包含a8093152e673feb7aba1828c43532094,就不会显示了 哦哦,明白了。

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