Support » Themes and Templates » Wrong background colour in HTML text

  • Resolved viotto

    (@viotto)


    Hi,
    I would like to use the http://hilite.me/ code hilighter on my WordPress website, since it is my preferred code hilighter and worked great on my previous site. I tried a few code highliter plugins for WordPress but still I would prefer to use this service, which simply generates formatted hmtl of the code, and has got plenty of options regarding code language and style.

    This is the code generated in hilite.me, which shows correct background (black):
    How it should look

    I pasted the html code from hilite.me to a raw html widget in wordpress, and this is screenshot of the result :
    Wrong background

    The background colour is wrong, it should be same background of rest of site (dark grey), instead is yellow.
    I checked theme options and seems not related to those.
    I post here HTML code generated from hilite.me, maybe there is something I need to edit? It worked well on my previous site, it wasn’t built with WordPress though.

    Thanks in advance for helping me out!

    <!-- HTML generated using hilite.me --><div style="background: #202020; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><table><tr><td><pre style="margin: 0; line-height: 125%"> 1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34</pre></td><td><pre style="margin: 0; line-height: 125%"><span style="color: #999999; font-style: italic">/*****************************************************************************\</span>
    <span style="color: #999999; font-style: italic">*</span>
    <span style="color: #999999; font-style: italic">*  CryptoGear Encryption Algorithm</span>
    <span style="color: #999999; font-style: italic">*</span>
    <span style="color: #999999; font-style: italic">******************************************************************************/</span>
    
    <span style="color: #999999; font-style: italic">// Cipher Modes of operation:</span>
    <span style="color: #cd2828; font-weight: bold">#define MODE_ECB 0  </span><span style="color: #999999; font-style: italic">// Electronic Codebook</span>
    <span style="color: #cd2828; font-weight: bold">#define MODE_CBC 1  </span><span style="color: #999999; font-style: italic">// Cipher Block Chaining</span>
    
    <span style="color: #6ab825; font-weight: bold">class</span> <span style="color: #447fcf; text-decoration: underline">CCryptoGear</span>
    <span style="color: #d0d0d0">{</span>
    <span style="color: #d0d0d0">private:</span>
    	<span style="color: #6ab825; font-weight: bold">static</span> <span style="color: #6ab825; font-weight: bold">const</span> <span style="color: #6ab825; font-weight: bold">unsigned</span> <span style="color: #6ab825; font-weight: bold">char</span> <span style="color: #d0d0d0">m_InitializationVector</span> <span style="color: #d0d0d0">=</span> <span style="color: #3677a9">0</span><span style="color: #d0d0d0">;</span> <span style="color: #999999; font-style: italic">// 0-255</span>
    	<span style="color: #6ab825; font-weight: bold">static</span> <span style="color: #6ab825; font-weight: bold">const</span> <span style="color: #6ab825; font-weight: bold">unsigned</span> <span style="color: #6ab825; font-weight: bold">short</span> <span style="color: #d0d0d0">m_lenKeystream</span> <span style="color: #d0d0d0">=</span> <span style="color: #3677a9">256</span><span style="color: #d0d0d0">;</span>
    	<span style="color: #6ab825; font-weight: bold">unsigned</span> <span style="color: #6ab825; font-weight: bold">char</span> <span style="color: #d0d0d0">m_ModeOfOperation;</span>
    	<span style="color: #6ab825; font-weight: bold">unsigned</span> <span style="color: #6ab825; font-weight: bold">char</span> <span style="color: #d0d0d0">m_KeyStream[m_lenKeystream];</span>
    
    <span style="color: #d0d0d0">public:</span>
    	<span style="color: #d0d0d0">CCryptoGear(</span><span style="color: #6ab825; font-weight: bold">unsigned</span> <span style="color: #6ab825; font-weight: bold">char</span><span style="color: #d0d0d0">*</span> <span style="color: #d0d0d0">pKey,</span> 
    		<span style="color: #6ab825; font-weight: bold">unsigned</span> <span style="color: #6ab825; font-weight: bold">int</span> <span style="color: #d0d0d0">lenKey,</span> 
    		<span style="color: #6ab825; font-weight: bold">unsigned</span> <span style="color: #6ab825; font-weight: bold">char</span> <span style="color: #d0d0d0">ModeOfOperation</span> <span style="color: #d0d0d0">=</span> <span style="color: #d0d0d0">MODE_CBC,</span>
    		<span style="color: #6ab825; font-weight: bold">unsigned</span> <span style="color: #6ab825; font-weight: bold">char</span> <span style="color: #d0d0d0">InitializationVector</span> <span style="color: #d0d0d0">=</span> <span style="color: #d0d0d0">m_InitializationVector);</span>
    
    	<span style="color: #d0d0d0">CCryptoGear();</span>
    
    	<span style="color: #6ab825; font-weight: bold">void</span> <span style="color: #447fcf">Initialize</span><span style="color: #d0d0d0">(</span><span style="color: #6ab825; font-weight: bold">unsigned</span> <span style="color: #6ab825; font-weight: bold">char</span><span style="color: #d0d0d0">*</span> <span style="color: #d0d0d0">pKey,</span> <span style="color: #6ab825; font-weight: bold">unsigned</span> <span style="color: #6ab825; font-weight: bold">int</span> <span style="color: #d0d0d0">lenKey,</span> 
    		<span style="color: #6ab825; font-weight: bold">unsigned</span> <span style="color: #6ab825; font-weight: bold">char</span> <span style="color: #d0d0d0">ModeOfOperation</span> <span style="color: #d0d0d0">=</span> <span style="color: #d0d0d0">MODE_CBC,</span>
    		<span style="color: #6ab825; font-weight: bold">unsigned</span> <span style="color: #6ab825; font-weight: bold">char</span> <span style="color: #d0d0d0">InitializationVector</span> <span style="color: #d0d0d0">=</span> <span style="color: #d0d0d0">m_InitializationVector);</span>
    
    	<span style="color: #6ab825; font-weight: bold">void</span> <span style="color: #447fcf">Encrypt</span><span style="color: #d0d0d0">(</span><span style="color: #6ab825; font-weight: bold">unsigned</span> <span style="color: #6ab825; font-weight: bold">char</span> <span style="color: #d0d0d0">pData[],</span> <span style="color: #6ab825; font-weight: bold">unsigned</span> <span style="color: #6ab825; font-weight: bold">long</span> <span style="color: #d0d0d0">lenData);</span>
    	<span style="color: #6ab825; font-weight: bold">void</span> <span style="color: #447fcf">Decrypt</span><span style="color: #d0d0d0">(</span><span style="color: #6ab825; font-weight: bold">unsigned</span> <span style="color: #6ab825; font-weight: bold">char</span> <span style="color: #d0d0d0">pData[],</span> <span style="color: #6ab825; font-weight: bold">unsigned</span> <span style="color: #6ab825; font-weight: bold">long</span> <span style="color: #d0d0d0">lenData);</span>
    <span style="color: #d0d0d0">};</span>
    </pre></td></tr></table></div>
    
    • This topic was modified 1 year ago by  viotto.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Sage Brownell

    (@sage-chara)

    Hi there!

    Would you mind linking to the page where this shows on your site? That way I can take a proper look at the CSS and see what exactly might be causing your code to be overwritten.

    Thanks,
    Sage

    viotto

    (@viotto)

    Hi Sage,
    yes, sure, link is: https://breaking-security.net/source-codes/csources/

    Thanks for having a look into it.

    Sage Brownell

    (@sage-chara)

    Hey there,

    Sorry for the delayed reply! Looking at your site though, I’m seeing the backgrounds as black, is this issue resolved?

    Let me know,
    Sage

    viotto

    (@viotto)

    Hi,
    meanwhile I fixed that page using Mivhak syntax highlighter wordpress plugin,
    but I provide other page where the code produced by hilite.me has wrong background: https://breaking-security.net/source-codes/vb6sources/

    Thanks

    Sage Brownell

    (@sage-chara)

    Hello there!

    Something like this should do the trick:

    .wpb_raw_code pre {
    	background-color: #202020;
    }

    Hope that helps!
    Sage

    viotto

    (@viotto)

    It did the trick!
    Thank you so much. 🙂

    Sage Brownell

    (@sage-chara)

    Huzzah! No worries ^_^

    If your question has been answered, we would love if you would mark this topic as resolved in the left hand sidebar. This helps our volunteers find the topics that still need attention and more people will get helped, possibly like you did.

    viotto

    (@viotto)

    Sure, I confirm it’s solved!
    Cheers

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Wrong background colour in HTML text’ is closed to new replies.