1

I would like to make something similar to the blue rectangle code block here: Is there any website that can help to just embed it, or it is 100% custom? Any help would be appreciated.

Armali
  • 18,255
  • 14
  • 57
  • 171
Hawyar Farooq
  • 41
  • 2
  • 2

1 Answers1

5

At a basic level you could use a textarea to show your code:

https://jsfiddle.net/qbgr17dx/

If you want to get automated styling of the code block you can use a JavaScript library such as PrismJS, this will automatically highlight syntax and code within your code blocks on your webpage:

https://prismjs.com/

You would then need to use the <code> and <pre> HTML tags, this allows your HTML to be output and shown to the user rather than the web-browser trying to show it as code/markup.

Alexander Wigmore
  • 3,157
  • 4
  • 38
  • 60