Add color to your code block

doldoki

doldoki

Posted on December 26, 2021

Add color to your code block

So you started a blog on dev.to but when you wrote your code in a code block, you noticed this.

let str = 'Hello World';
console.log(str);
Enter fullscreen mode Exit fullscreen mode

Fortunately, dev.to offers an easy way to add colors to your codes for better display and readability.

let str = 'Hello World';
console.log(str);
Enter fullscreen mode Exit fullscreen mode

Simply add the name of your programming language right after the first three back-ticks(or the opening back-ticks) for your code block.

I tried Python, Javascript, and PHP. They all worked fine.

💖 💪 🙅 🚩
doldoki
doldoki

Posted on December 26, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related