.cheatsheet div.demo~pre {
margin-top: 0;
}
+ .cheatsheet pre {
+ white-space: pre-wrap;
+ overflow-wrap: break-word;
+ }
.cheatsheet > div {
border: 1px solid lightgray;
border-radius: 20px;
</head>
<p>Hello World</p>
<script>$("p").css("color", "yellow");</script>
-<script src="https://ajax.googleapis.com/ajax/libs
- /jquery/3.7.1/jquery.min.js"></script>
+<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
</code></pre>
JS is executed immediately. If your JS is included at the top of a file, delay it until document load:<ul>