0 votes
in JavaScript by
Is it possible to add CSS to console messages in Javascript?

1 Answer

0 votes
by

Yes, you can apply CSS styles to console messages similar to html text on the web page.

console.log(
  "%c The text has blue color, with large font and red background",
  "color: blue; font-size: x-large; background: red"
);

The text will be displayed as below, Screenshot

Note: All CSS styles can be applied to console messages.

...