首页新闻招聘找找看知识库
  • 回复:6 浏览:54 2019-08-14 15:00 来自 hzoiooo

    博客园的blog-common.css导致本人的代码高亮方案被覆盖
    具体问题:
    我将自己的代码带类型粘贴至编辑页面,但保存并打开后代码的类型发生了变化
    请问有什么解决方法

  • 博客园团队
    2019-08-14 15:17 博客园团队
    您好,请您提供一下链接呢
    第1楼 回到顶楼
  • hzoiooo
    2019-08-14 15:20 hzoiooo

    https://www.cnblogs.com/ooovooo/
    我的css:

    .hll { background-color: #d6d6d6 } .pl-c { color: #8e908c } /* Comment */ .pl-err { color: #c82829 } /* Error */ .pl-k { color: #8959a8 } /* Keyword */ .pl-l { color: #f5871f } /* Literal */ .pl-n { color: #3B005D } /* Name */ .pl-o { color: #005A85 } /* Operator */ .pl-p { color: #4d4d4c } /* Punctuation */ .pl-ch { color: #8e908c } /* Comment.Hashbang */ .pl-cm { color: #8e908c } /* Comment.Multiline */ .pl-cp { color: #C673BD } /* Comment.Preproc */ .pl-cpf { color:#0092FF } /* Comment.PreprocFile */ .pl-c1 { color: #8e908c } /* Comment.Single */ .pl-cs { color: #8e908c } /* Comment.Special */ .pl-gd { color: #c82829 } /* Generic.Deleted */ .pl-ge { font-style: italic } /* Generic.Emph */ .pl-gh { color: #4d4d4c; font-weight: bold } /* Generic.Heading */ .pl-gi { color: #718c00 } /* Generic.Inserted */ .pl-gp { color: #8e908c; font-weight: bold } /* Generic.Prompt */ .pl-gs { font-weight: bold } /* Generic.Strong */ .pl-gu { color: #3e999f; font-weight: bold } /* Generic.Subheading */ .pl-kc { color: #8959a8 } /* Keyword.Constant */ .pl-kd { color: #8959a8 } /* Keyword.Declaration */ .pl-kn { color: #3e999f } /* Keyword.Namespace */ .pl-kp { color: #8959a8 } /* Keyword.Pseudo */ .pl-kr { color: #8959a8 } /* Keyword.Reserved */ .pl-il { color: #f5871f } /* Literal.Number.Integer.Long */ .pl-kt { color: #eab700 } /* Keyword.Type */ .pl-ld { color: #718c00 } /* Literal.Date */ .pl-m { color: #f5871f } /* Literal.Number */ .pl-s { color: #718c00 } /* Literal.String */ .pl-na { color: #4271ae } /* Name.Attribute */ .pl-nb { color: #4d4d4c } /* Name.Builtin */ .pl-nc { color: #eab700 } /* Name.Class */ .pl-no { color: #c82829 } /* Name.Constant */ .pl-nd { color: #3e999f } /* Name.Decorator */ .pl-ni { color: #4d4d4c } /* Name.Entity */ .pl-ne { color: #c82829 } /* Name.Exception */ .pl-nf { color: #4271ae } /* Name.Function */ .pl-nl { color: #4d4d4c } /* Name.Label */ .pl-nn { color: #eab700 } /* Name.Namespace */ .pl-nx { color: #4271ae } /* Name.Other */ .pl-py { color: #4d4d4c } /* Name.Property */ .pl-nt { color: #3e999f } /* Name.Tag */ .pl-nv { color: #c82829 } /* Name.Variable */ .pl-ow { color: #3e999f } /* Operator.Word */ .pl-w { color: #4d4d4c } /* Text.Whitespace */ .pl-mb { color: #f5871f } /* Literal.Number.Bin */ .pl-mf { color: #f5871f } /* Literal.Number.Float */ .pl-mh { color: #f5871f } /* Literal.Number.Hex */ .pl-mi { color: #f5871f } /* Literal.Number.Integer */ .pl-mo { color: #f5871f } /* Literal.Number.Oct */ .pl-sb { color: #718c00 } /* Literal.String.Backtick */ .pl-sc { color: #4d4d4c } /* Literal.String.Char */ .pl-sd { color: #8e908c } /* Literal.String.Doc */ .pl-s2 { color: #718c00 } /* Literal.String.Double */ .pl-se { color: #f5871f } /* Literal.String.Escape */ .pl-sh { color: #718c00 } /* Literal.String.Heredoc */ .pl-si { color: #f5871f } /* Literal.String.Interpol */ .pl-sx { color: #718c00 } /* Literal.String.Other */ .pl-sr { color: #718c00 } /* Literal.String.Regex */ .pl-s1 { color: #718c00 } /* Literal.String.Single */ .pl-ss { color: #718c00 } /* Literal.String.Symbol */ .pl-bp { color: #4d4d4c } /* Name.Builtin.Pseudo */ .pl-vc { color: #c82829 } /* Name.Variable.Class */ .pl-vg { color: #c82829 } /* Name.Variable.Global */ .pl-vi { color: #c82829 } /* Name.Variable.Instance */ .pl-il { color: #f5871f } /* Literal.Number.Integer.Long */ .hljs-string{ color: #FF7800 !important;}
    但是代码的类型被改变了

    第2楼 回到顶楼
  • hzoiooo
    2019-08-14 15:21 hzoiooo

    以及
    在随笔编辑中添加的html

    <pre style="margin-top: 0px; margin-bottom: 0px;"><code><span class="pl-cp">#include</span><span class="pl-cpf">&lt;iostream&gt;</span><span class="pl-cp"></span>
    <span class="pl-cp">#include</span><span class="pl-cpf">&lt;cstdio&gt;</span><span class="pl-cp"></span>
    <span class="pl-k">using</span> <span class="pl-k">namespace</span> <span class="pl-n">std</span><span class="pl-p">;</span>
    <span class="pl-cp">#define int long long</span>
    <span class="pl-kt">int</span> <span class="pl-n">a</span><span class="pl-p">[</span><span class="pl-mi">20</span><span class="pl-p">],</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-mi">20</span><span class="pl-p">],</span><span class="pl-n">c</span><span class="pl-p">[</span><span class="pl-mi">20</span><span class="pl-p">],</span><span class="pl-n">d</span><span class="pl-p">[</span><span class="pl-mi">20</span><span class="pl-p">];</span>
    <span class="pl-kt">int</span> <span class="pl-n">n</span><span class="pl-p">;</span>
    <span class="pl-kt">int</span> <span class="pl-n">ans</span><span class="pl-o">=</span><span class="pl-mi">0</span><span class="pl-p">;</span>
    <span class="pl-kt">int</span> <span class="pl-nf">max</span><span class="pl-p">(</span><span class="pl-kt">int</span> <span class="pl-n">a</span><span class="pl-p">,</span><span class="pl-kt">int</span> <span class="pl-n">b</span><span class="pl-p">)</span>
    <span class="pl-p">{</span><span class="pl-k">if</span><span class="pl-p">(</span><span class="pl-n">a</span><span class="pl-o">&gt;</span><span class="pl-n">b</span><span class="pl-p">)</span><span class="pl-k">return</span> <span class="pl-n">a</span><span class="pl-p">;</span><span class="pl-k">return</span> <span class="pl-n">b</span><span class="pl-p">;}</span>
    <span class="pl-kt">void</span> <span class="pl-nf">dfs</span><span class="pl-p">(</span><span class="pl-kt">int</span> <span class="pl-n">k</span><span class="pl-p">,</span><span class="pl-kt">int</span> <span class="pl-n">o</span><span class="pl-p">,</span><span class="pl-kt">int</span> <span class="pl-n">w</span><span class="pl-p">)</span>
    <span class="pl-p">{</span>
        <span class="pl-k">if</span><span class="pl-p">(</span><span class="pl-n">k</span><span class="pl-o">==</span><span class="pl-n">n</span><span class="pl-o">+</span><span class="pl-mi">1</span><span class="pl-p">){</span><span class="pl-n">ans</span><span class="pl-o">=</span><span class="pl-n">max</span><span class="pl-p">(</span><span class="pl-n">ans</span><span class="pl-p">,</span><span class="pl-n">o</span><span class="pl-o">*</span><span class="pl-n">w</span><span class="pl-p">);</span><span class="pl-k">return</span><span class="pl-p">;}</span>
        <span class="pl-n">dfs</span><span class="pl-p">(</span><span class="pl-n">k</span><span class="pl-o">+</span><span class="pl-mi">1</span><span class="pl-p">,</span><span class="pl-n">o</span><span class="pl-o">+</span><span class="pl-n">c</span><span class="pl-p">[</span><span class="pl-n">k</span><span class="pl-p">],</span><span class="pl-n">max</span><span class="pl-p">(</span><span class="pl-mi">0</span><span class="pl-p">,</span><span class="pl-n">w</span><span class="pl-o">-</span><span class="pl-n">d</span><span class="pl-p">[</span><span class="pl-n">k</span><span class="pl-p">]));</span>
        <span class="pl-n">dfs</span><span class="pl-p">(</span><span class="pl-n">k</span><span class="pl-o">+</span><span class="pl-mi">1</span><span class="pl-p">,</span><span class="pl-n">max</span><span class="pl-p">(</span><span class="pl-mi">0</span><span class="pl-p">,</span><span class="pl-n">o</span><span class="pl-o">-</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">k</span><span class="pl-p">]),</span><span class="pl-n">w</span><span class="pl-o">+</span><span class="pl-n">a</span><span class="pl-p">[</span><span class="pl-n">k</span><span class="pl-p">]);</span>
    <span class="pl-p">}</span>
    <span class="pl-kt">signed</span> <span class="pl-nf">main</span><span class="pl-p">()</span>
    <span class="pl-p">{</span>
        <span class="pl-n">cin</span><span class="pl-o">&gt;&gt;</span><span class="pl-n">n</span><span class="pl-p">;</span>
        <span class="pl-k">for</span><span class="pl-p">(</span><span class="pl-kt">int</span> <span class="pl-n">q</span><span class="pl-o">=</span><span class="pl-mi">1</span><span class="pl-p">;</span><span class="pl-n">q</span><span class="pl-o">&lt;=</span><span class="pl-n">n</span><span class="pl-p">;</span><span class="pl-n">q</span><span class="pl-o">++</span><span class="pl-p">)</span>
            <span class="pl-n">cin</span><span class="pl-o">&gt;&gt;</span><span class="pl-n">a</span><span class="pl-p">[</span><span class="pl-n">q</span><span class="pl-p">]</span><span class="pl-o">&gt;&gt;</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">q</span><span class="pl-p">]</span><span class="pl-o">&gt;&gt;</span><span class="pl-n">c</span><span class="pl-p">[</span><span class="pl-n">q</span><span class="pl-p">]</span><span class="pl-o">&gt;&gt;</span><span class="pl-n">d</span><span class="pl-p">[</span><span class="pl-n">q</span><span class="pl-p">];</span>
        <span class="pl-n">dfs</span><span class="pl-p">(</span><span class="pl-mi">1</span><span class="pl-p">,</span><span class="pl-mi">0</span><span class="pl-p">,</span><span class="pl-mi">0</span><span class="pl-p">);</span>
        <span class="pl-n">cout</span><span class="pl-o">&lt;&lt;</span><span class="pl-n">ans</span><span class="pl-o">&lt;&lt;</span><span class="pl-n">endl</span><span class="pl-p">;</span>
    <span class="pl-cm">/*  cout&lt;&lt;bj&lt;&lt;endl;*/</span>
    <span class="pl-p">}</span>
    </code><div></div></pre>
    第3楼 回到顶楼
  • 博客园团队
    2019-08-14 16:21 博客园团队
    您好,建议您修改html源码。将code的class修改,例如<pre><code class="nohighlight">...</code></pre>
    第4楼 回到顶楼
  • hzoiooo
    2019-08-14 16:28 hzoiooo

    问题已解决,太感谢了,好评!!!!!

    第5楼 回到顶楼
  • YJLAugus
    2019-08-15 21:15 YJLAugus

    是呢。有时候官方的模板会莫名加上 !important

    第6楼 回到顶楼
登录后才能评论,请先登录注册