I am currently building a website containing code snippets and wondered how StackOverflow does it. I try to recreate it many times, but no matter what I do, I just can't recreate it and I can't find anyone or anything that explains how to do it. Does anyone know how StackOverflow manages to create code snippets like this:
#include <iostream>
int main(){
std::cout << "Hello World!" << std::endl;
return 0;
}
I know that it uses <pre> and <code> but even knowing that I can't find an explanation of what I need to do to recreate it. Can someone help me to find a way to recreate this code snippet style please?