DEV Community

Cover image for How to highlight a code block on dev.to
Ifeoluwa isaiah
Ifeoluwa isaiah

Posted on

How to highlight a code block on dev.to

I found that this code was generally more pleasing to the eyes

const name = 'Ifeoluwa'
function Welcome() {
console.log(`Welcome ${name} you made it here!`)
}
Enter fullscreen mode Exit fullscreen mode

To this below

const name = 'Ifeoluwa'
function Welcome() {
console.log(`Welcome ${name} you made it here!`)
}
Enter fullscreen mode Exit fullscreen mode

What's the secret? Nothing too complicated. To achieve this, you only need to specify the language the code is written in.

Normally when you open a code block it goes something like

block code

Add the name like this

block code

And it will render this

const msg = 'You did it!';
Enter fullscreen mode Exit fullscreen mode

Conclusion

Congratulations! Now your blog post would have a nicer look from today onward, thanks for reading.

Top comments (0)