Contact

How to Add a Colour Background to Text Blocks

Sometime we want to use a different background color for special or selected text. Please look some demo text from bellow:
Demo-1: (Add html code with background)
Step-1:
  • Add bellow code to your post HTML
<pre class="prettyprint _3t10 prettyprinted" style="background-color: #d2d0d0; border: none; padding: 12px;"><span style="color: #38761d; font-family: menlo, consolas, monaco, monospace;"><span style="font-size: 14px; white-space: pre-wrap;">Replace This Text</span></span></pre>
Step-2: (Customize)
  • Look at above code: 
  • Change background-color: #d2d0d0 to another color
  • Change padding: 12px to another side. (padding is your text around space)
Please comment me, If you face any problem.

No comments

Powered by Blogger.