You can add code into an HTML Web page with a few simple steps using the <pre> and <code> HTML Tags.
In addition to the two HTML tags you will also want to define a CSS Style for the two tags to make them show up as expected on your page.
<style>
pre code {
background-color: #eee;
border: 1px solid #999;
display: block;
padding: 10px;
}
</style>
<pre>
<code>
// My Comment here
public String answerWithAmazingThings(String questions) {
return "The Wizard is Busy Today";
}
</code>
</pre>
// My Comment here
public String answerWithAmazingThings(String questions) {
return "The Wizard is Busy Today";
}
That Fast and Simple!