DEV Community

Aleksandr Ippatev
Aleksandr Ippatev

Posted on

1 1

How to Style console.log?

To add CSS styling to the console output, we use the CSS format specifier %c. Then we start the console message, which is usually a String with the specifier followed by the message we intend to log, and, finally, the styles we want to apply to the message:

console.log("%cThis is a green text", "color:green");
Enter fullscreen mode Exit fullscreen mode

screenshots

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up