简体   繁体   English

为什么Google Code Prettify无法在CSS上运行?

[英]Why isn't Google Code Prettify working on css?

I'm using prettify.js for some blog posts. 我在一些博客文章中使用prettify.js。 It's handling my html, python, and js fine, but missing the css. 它可以很好地处理我的html,python和js,但缺少CSS。

My html is: 我的html是:

<pre>
<code class="prettyprint lang-css">`

    .my-boxclass {
        display: inline-block;
        position: relative;
        cursor: help;
        border-bottom: 1px dotted grey;
    }
</code>
</pre>

and I'm importing prettify. 而且我正在导入美化。 Here's a jsfiddle of exactly what I'm doing (and it's not syntax highlighting the jsfiddle correctly either) https://jsfiddle.net/kfdqLjm1/2/ 这是我正在做的事情的jsfiddle(它也不是正确突出显示jsfiddle的语法) https://jsfiddle.net/kfdqLjm1/2/

You need to load the CSS language handler. 您需要加载CSS语言处理程序。 Try adding ?lang=css after run_prettify.js . 尝试在run_prettify.js之后添加?lang=css

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM