本实例是使用Javascript插件,在浏览器客户端动态的为代码着色,可以显示行号.
Javascript代码着色实例效果:http://www.keleyi.com/keleyi/phtml/codecolor/a/index.htm
以下是代码:
复制代码 代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Javascript代码高亮着色显行号-柯乐义</title>
<script type="text/javascript" src="/UploadFiles/2021-04-02/shCore.js"><script type="text/javascript" src="/UploadFiles/2021-04-02/shBrushJScript.js"><link type="text/css" rel="stylesheet" href="http://www.keleyi.com/keleyi/phtml/codecolor/a/styles/shCoreDefault.css"/>
<script type="text/javascript">SyntaxHighlighter.all();</script>
</head>
<body style="background: white; font-family: Helvetica">
<h1>Javascript代码高亮着色显行号</h1>
<pre class="brush: js;">
function KeleyiColor()
{
document.write('keleyi.com');
return "hi!";
}
</pre>
</body>
</html>
历史版本:
http://www.keleyi.com/keleyi/phtml/codecolor/index.htm
Javascript代码着色实例效果:http://www.keleyi.com/keleyi/phtml/codecolor/a/index.htm
以下是代码:
复制代码 代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Javascript代码高亮着色显行号-柯乐义</title>
<script type="text/javascript" src="/UploadFiles/2021-04-02/shCore.js"><script type="text/javascript" src="/UploadFiles/2021-04-02/shBrushJScript.js"><link type="text/css" rel="stylesheet" href="http://www.keleyi.com/keleyi/phtml/codecolor/a/styles/shCoreDefault.css"/>
<script type="text/javascript">SyntaxHighlighter.all();</script>
</head>
<body style="background: white; font-family: Helvetica">
<h1>Javascript代码高亮着色显行号</h1>
<pre class="brush: js;">
function KeleyiColor()
{
document.write('keleyi.com');
return "hi!";
}
</pre>
</body>
</html>
历史版本:
http://www.keleyi.com/keleyi/phtml/codecolor/index.htm
标签:
代码着色,行号
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“js动态为代码着色显示行号”评论...