all()与highlight()区别在于all()是注册到onload()事件中的。 4、在博客园中使用 博客园默认支持SyntaxHighlighter。代码修改默认值(因为jQuery不支持设置!important的样式所以需要设置cssText): 复制代码 代码如下: var sh = $(".syntaxhighlighter"); var code = sh.find("code"); var line = sh.find(".line"); var caption = sh.find("table caption"); sh.css("cssText", "width: auto !important"); code.add(line) .add(caption) .css("cssText", "font-size: 20px !important;white-space: nowrap !important;line-height: 1.5em !important;");