Videos
Sharing an example I use in website, I do use following pre in my stylesheet:
pre {
background: #f4f4f4;
border: 1px solid #ddd;
border-left: 3px solid #f36d33;
color: #666;
page-break-inside: avoid;
font-family: monospace;
font-size: 15px;
line-height: 1.6;
margin-bottom: 1.6em;
max-width: 100%;
overflow: auto;
padding: 1em 1.5em;
display: block;
word-wrap: break-word;
}
This gives the following results:

Disclaimer: In my leisure time, I have spend few hours to update this CSS with a bit extra features like code lines and code Copy button using CSS with JavaScript to my personal use that I like to share. Please use as you like github source code. To see a code example in real world, check this article from my blog that show how I use the code sample.
This javascript library seems excellent:
https://highlightjs.org/
UPDATE: I also used this on my Tumblr-based blog because it was easiest to deploy:
https://github.com/google/code-prettify
Link to the tutorial: https://easyhtmlcss.com/
Hi! I'm a full stack web dev, and I really like to help people learn programming. I wanted to make a super easy HTML/CSS tutorial meant to help people get started no matter how inexperienced you are. The point of this tutorial is not to go super in depth on everything, but to get you to a good starting point for further exploration. You'll learn how to make HTML files and link them together, add text and images, and customize things like your font, colors, and borders. The tutorial is structured in bite-sized pieces without giving too much information at once - so if you have found other HTML/CSS tutorials overwhelming, this one is for you.
I put a lot of work into this tutorial so I hope you check it out and I hope that it can help at least one person get started. Happy learning :)