我试图在Blogger上使用SyntaxHighlighter 3.0.83来突出显示一些简单的Java代码,但我的单个Java行被分成许多块。这是我所做的设置:Blogger:设计|范本|编辑HTML在之前添加了以下几行:<link href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css'/><link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeEmacs.css' rel='stylesheet' type='text/css'/>然后,在末尾之前添加这些行:<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'/><script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js' type='text/javascript'/><script language='javascript' type='text/javascript'>SyntaxHighlighter.config.bloggerMode = true;SyntaxHighlighter.defaults.toolbar = false;SyntaxHighlighter.all();</script>然后我的帖子是:<pre class="brush:java">MyJFrame.this.processWindowEvent(new WindowEvent(MyJFrame.this, WindowEvent.WINDOW_CLOSED));</pre>我得到的是:显然如何使用每个单词分隔符拆分我的行?谢谢 (adsbygoogle = window.adsbygoogle || []).push({}); 最佳答案 我终于明白了:我以前为<code> HTML标签向Blogger添加了CSS定制,如下所示:code { border: 1px solid #ccc; background-color: #f6f6f6; font: 0.8em 'Courier New', Courier, Fixed; border-spacing: 0; padding: 0.3em; display: block;}罪魁祸首是display : block;,它扰乱了SyntaxHighlighter。用code {...}替换pre code {...}对我有用。 (adsbygoogle = window.adsbygoogle || []).push({}); 07-26 09:02