如何在这些论坛中将代码显示为文本? [英] How can I Display code as text like in these forums?

查看:106
本文介绍了如何在这些论坛中将代码显示为文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将代码显示为只读代码就像代码按钮选项一样?


我希望它能用于任何不仅仅是php或html的内容,或者mysql或c#但所有代码输入的解决方案只是一个完整的禁用和发布解决方案。

How can I display code as read only just like the code button option on this?

I want it to work for anything that is inputed not just php, or html, or mysql, or c# but one solution for all code input just a complete disabling and posting solution.

展开 | 选择 | Wrap | 行号

推荐答案

你想要它的哪一部分?
  • 格式是固定宽度的字体。最常见的网络安全等宽字体是Courier New。
  • 如果您想要编号,请将每一行分成列表项并将整个元素作为列表。
  • 如果你想要代码上面的选项,你需要用JavaScript制作它们。
What part of it do you want?
  • The formatting is a fixed-width font. The most common web-safe monospaced font is ''Courier New.''
  • If you want the numbering, break each line into list items and make the entire element a list.
  • If you want the options above the code, you''ll need to make them in JavaScript.


谢谢。如何将代码显示为可读文本而不是执行那些我真正想要的东西。像代码括号按钮。我正在使用php,html和java但它可以让它显示而不是执行


例如,下面会显示为文本,而不是发布和尝试执行。


Thanks. What about having the code display as just readable text and not executing thats what im really after. Like the code bracket button. I''m using php, html, and java but it I can get it to display instead of execute

For example the below would show as text like it is instead of posting and trying to execute.


展开 | 选择 | Wrap | 行号


谢谢。我添加了一个更好的示例,我想知道如何将代码发布为纯文本,就像代码按钮允许的那样。
thanks. i added a better example I want to find out how to post the code as plain text like the code button allows you to do.


这篇关于如何在这些论坛中将代码显示为文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆