使用 google-code-prettify 防止程序(源代码)超出显示区域

谷歌代码美化突出

你好,这是 naouniverse ( @naouniverse708 )。

上一篇文章,

安装 google-code-prettify 并将程序(源代码)发布到您的博客上

google-code-prettify 但是将我的博客迁移到 WordPress 后,出现了源代码突出的情况。

为了避免这种情况,我们做了一些修改。

<link rel="stylesheet" href="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css" type="text/css" media="screen" /> <script type="text/javascript" src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ prettyPrint(); }); </script> <style type="text/css"> pre.prettyprint { background-color: rgb(248, 248, 248); color: gray; padding: 0 0 0 3px; overflow: auto; } ol.linenums li { list-style: decimal outside; line-height: 1.5; border-left: solid 3px #6CE26C; padding-left: 3px; margin-left: .7em; background-color: rgb(248, 248, 248); } </style>

内部 pre.prettyprint

溢出:自动;

额外。

我认为这是一个很好的展示。

  • 将此条目添加到 Hatena 书签

在“naouniverse.com”,管理员写的是他感兴趣的事物、事物和世界。
小玩意、相机、设计、编程、L'Arc~en~Ciel等...