zoukankan      html  css  js  c++  java
  • 代码高亮调整试验

    历时两天,终于搞定了博客园的代码高亮了。

    首先,请大家参考一下这篇文章的作法:博客园配置windows live writer,实现本地代码高亮

    由于SyntaxHighlighter的版本更新了,所以文件的使用应该用新版本的SyntaxHighlighter

    不过现在博客园的子标题不允许插入javascript代码了,所以我们把代码放进页首或者页尾html里面。(首先你需要申请博客的js权限)

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    会HTML的朋友应该知道{{your_blog_name}}是一个需要渲染的名字,所以{{your_blog_name}}要改成使用者博客的名字。

    但是还有一个问题:博主在高亮完之后发现行列不对齐了!

     查看了shCore.css文件发现 由于里面的这句话含有了!important属性 导致了部分代码的行高不正确

    .syntaxhighlighter textarea {
      -moz-border-radius: 0 0 0 0 !important;
      -webkit-border-radius: 0 0 0 0 !important;
      background: none !important;
      border: 0 !important;
      bottom: auto !important;
      float: none !important;
      height: auto !important;
      left: auto !important;
      line-height: 1.1em !important;  /* Thsi line! */
      margin: 0 !important;
      outline: 0 !important;
      overflow: visible !important;
      padding: 0 !important;
      position: static !important;
      right: auto !important;
      text-align: left !important;
      top: auto !important;
      vertical-align: baseline !important;
       auto !important;
      box-sizing: content-box !important;
      font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
      font-weight: normal !important;
      font-style: normal !important;
      font-size: 1em !important;
      min-height: inherit !important;
      min-height: auto !important;
    }
    

    所以只需要把shCore.css这一句话的!important属性去掉即可,更新文档即可。 (目前博主把文件面所有!important属性都去掉了,暂时没有发现问题。)

  • 相关阅读:
    Leetcode: Reverse Integer
    Leetcode: Two Sum
    Leetcode: Path Sum
    make distclean
    makefile 中 foreach
    nor flash 和 nand flash
    端口(port)的安全模式(security mode)
    单片机入门(二)
    单片机入门(一)
    kworker
  • 原文地址:https://www.cnblogs.com/DingCao/p/code_highlight.html
Copyright © 2011-2022 走看看