Answers for "console log info color"

23

js console log with color

console.log('%c Oh my heavens! ', 'background: #222; color: #bada55');
Posted by: Guest on April-09-2020
0

javascript colorized console.log

// 1. Pass the css styles in an array
const styles = [
  'color: green',
  'background: yellow',
  'font-size: 30px',
  'border: 1px solid red',
  'text-shadow: 2px 2px black',
  'padding: 10px',
].join(';'); // 2. Concatenate the individual array item and concatenate them into a string separated by a semi-colon (;)

// 3. Pass the styles variable
console.log('%cHello There', styles);
Posted by: Guest on April-01-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language