title: How to color background on Chrome browser console with Javascript
body: <p>If I use <code>console.warn</code> or <code>console.error</code> the whole line background is colored respectively in yellow and red.</p>
  <p>However if I want to color the background with <code>console.log</code> it seems it is not possible with simple CSS commands.</p>
  <p>I was wondering if there are other methods to achieve that.</p>
  <p>This is the code I am using at the moment:</p>
  <pre class="lang-js prettyprint-override"><code>console.log('%c%s', 'background-color: purple;', 'Lorem ipsum (something) else: {}');
  console.warn('Lorem ipsum (something) else: {}');
  console.error('Lorem ipsum (something) else: {}');
  </code></pre>
  <p>In this screenshot you can see the difference:</p>
  <p><a href="https://i.stack.imgur.com/FZ9uB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FZ9uB.png" alt="different background colors for console" /></a></p>