Print console.log with custom style
Published in
1 min readMay 8, 2016
This happen when you tried to open Console panel in Facebook, you will see:
To print a message in Console panel with style like this, you can use the syntax:
console.log("%c<Your message>", "<css properties>");
For example:
console.log("%cWhy can't fish live out of water", "color: #F00; font-size: 50px;");
Another example, create a Stop message like Facebook:
console.log("%cStop!", "font-size: 50px; color: #F00; text-shadow: 1px 1px #000, -1px -1px #000, -1px 1px #000, 1px -1px #000")