简体   繁体   English

我想在我的网站的代码示例中添加行号。 我想通过CSS(生成的内容?)或javascript来完成此操作

[英]I would like to add line numbers to code samples on my web site. I would like to do this either thru CSS (generated content?) or javascript

See the code samples on http://www.smashingmagazine.com/2009/08/17/taming-advanced-css-selectors/ where the code samples have line numbers. 请参阅http://www.smashingmagazine.com/2009/08/17/taming-advanced-css-selectors/上的代码示例,其中的代码示例具有行号。 Turning Javascript off (in Firefox) shows these sections without the line numbers. 关闭Javascript(在Firefox中)将显示这些没有行号的部分。 I would like a script that accomplished line numbering. 我想要一个完成行编号的脚本。

Smashing Magazine, like many others, uses a JS library called SyntaxHighlighter . 与其他许多杂志一样,Smashing Magazine使用一个名为SyntaxHighlighter的JS库。

Another common one is Google Prettify . 另一个常见的例子Google Prettify

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我需要帮助修复我的代码 - I would like assistance in fixing my code 我想使用 HTML 和 JavaScript 执行 While 循环,但是使用我当前的代码循环并没有结束 - I would like to do a While loop using HTML and JavaScript however with my current code the loop is not ending 我想使用带有 for 循环的 javascript 用数字填充数组 - I would like to fill an array with numbers using javascript with a for loop 我想在初始化而不是内联时将内容添加到弹出窗口 - I would like to add content to the popover on init instead of inline 我想在我的网络中放置一个三角形并用图像填充它 - I would like to have a triangle in my web and filled it with images 如果元标记包含使用JQuery或JavaScript的特定文本,我想执行一行代码 - I would like to execute a line of code if a meta tag contains specific text using JQuery or JavaScript 我的textarea文本没有使用javascript样式化到CSS - My textarea text isn't styling the way that i would like it to CSS with javascript 我想知道这种在javascript中编写可重用代码的方法 - I would like to know this approach of writing reusable code in javascript 我想在 angularjs 中为倒数计时器添加暂停按钮 - I Would like to add pause button to my countdown timer in angularjs 我想在我的 Angular 应用程序中添加一个删除按钮 - I would like to add a remove button in my Angular App
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM