DEV Community

Discussion on: CSS animations - slide text

Collapse
 
link2twenty profile image
Andrew Bone

Hello!

If you'd like, you can add syntax highlighting (colours that make code easier to read) to your code block like the following example.

console.log('Hello world!');
Enter fullscreen mode Exit fullscreen mode

This should make it a bit easier to understand your code. 😎

In order to use this in your code blocks, you must designate the coding language you are using directly after the first three back-ticks. So in the example above, you'd write three back-ticks js (no space between the two), put the code beneath (e.g. console.log('Hello world!');), then three back-ticks beneath that to close the code.

Here's an image that shows how it's written!

Example of how to add syntax highlighting in code blocks

Collapse
 
texe profile image
Chris Texe

I corrected the code in this article, thank you for advice.

Collapse
 
texe profile image
Chris Texe • Edited

I will do it tomorrow! Didn't know that dev.to parses languages in markdown.

Collapse
 
damkols profile image
Kolapo Damola Usman

Good point Andrew
I do this with my articles too