我正试图重现 Tomorrow Night Blue
题材 code-prettify
作为 在此找到. 我有 这把琴. 输出看起来和例子中的完全不一样,每一行都是白色的。它似乎是在应用样式,但不是真的。我有。
<body onload="PR.prettyPrint()">
<pre class="prettyprint linenums lang-html">
<script type="text/javascript">
// Say hello world until the user starts questioning
// the meaningfulness of their existence.
function helloWorld(world) {
for (var i = 42; --i >= 0;) {
alert('Hello ' + String(world));
}
}
</script>
<style>
p { color: pink }
b { color: blue }
u { color: "umber" }
</style>
</pre>
</body>
我到底做错了什么?代码prettify项目 在这里 我以为我是按照这个例子来做的。
问题是在fiddle的css是在js之前,所以一些默认的样式没有被覆盖。我所要做的就是改变顺序。取而代之的是:
<link ...tomorrow-night-blue.css">
<link ...prettify.css">
改为:
<link ...prettify.css">
<link ...tomorrow-night-blue.css">