我正在尝试使用语法高亮显示但它不起作用。 这是你好的世界样本。
<!doctype html>
<html>
<head>
<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/shThemeDefault.css" rel="stylesheet" type="text/css" />
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js" type="text/javascript"></script>
</head>
<body>
<pre class"brush:cpp;">
int main()
{
std::cout << "Hello, world!";
return 0;
}
</pre>
<script type="text/javascript">
//SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
</script>
</body>
</html>
语法没有突出显示。
答案 0 :(得分:1)
你忘了课后的=
。
<!doctype html>
<html>
<head>
<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/shThemeDefault.css" rel="stylesheet" type="text/css" />
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js" type="text/javascript"></script>
</head>
<body>
<pre class="brush:cpp;">
int main()
{
std::cout << "Hello, world!";
return 0;
}
</pre>
<script type="text/javascript">
//SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
</script>
</body>
</html>