DEV Community

Cover image for How to style text in console in the browser?
Gaurav Singh
Gaurav Singh

Posted on

How to style text in console in the browser?

If you find it difficult to style the output, we can do it in the JavaScript console.

The steps are as follows:

  1. Click on Inspect Element in the browser's Developer Tools, and then scroll down to see your new string!

  2. Print this code in the JavaScript console:

console.log("%cHello world","font:size:40px; color:blue ");

Enter fullscreen mode Exit fullscreen mode

Change the text to whatever you want and then hit enter

Now you can see the changes in the console tab

Image description

Have fun and enjoy coding!😊

Top comments (1)

Collapse
 
anirudh_8088 profile image
Anirudh Raghuvanshi

intresting...🤔