-
Notifications
You must be signed in to change notification settings - Fork 0
/
highlight_code.html
73 lines (63 loc) · 1.66 KB
/
highlight_code.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>HighlightJS: code</title>
<!-- https://cdnjs.com/libraries/highlight.js -->
<!-- HighlightJS CSS: a11y-dark theme used -->
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/a11y-dark.min.css"
integrity="sha512-Vj6gPCk8EZlqnoveEyuGyYaWZ1+jyjMPg8g4shwyyNlRQl6d3L9At02ZHQr5K6s5duZl/+YKMnM3/8pDhoUphg=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>
<!-- HighlightJS script -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
<script>
hljs.highlightAll();
</script>
<style>
body {
margin: 25px;
}
h1 {
text-align: center;
}
h2 {
color: blueviolet;
}
</style>
</head>
<body>
<h1>Programming Languages</h1>
<h2>Python</h2>
<pre>
<code class="python">
for character in "abc":
print(character.upper()) # Prints A, then B, then C
</code>
</pre>
<h2>C#</h2>
<pre>
<code class="csharp">
public class Cat {
// Method of the Cat class
public void speak() {
Console.writeline("Meow!");
}
}
</code>
</pre>
<h2>Java</h2>
<pre>
<code class="java">
String[] names = { "Zoe", "Chloe", "Joey" };
// Print all of the names in the array
for (String name in names) {
System.out.println(name);
}
</code>
</pre>
</body>
</html>