|
You need to use HTML Entities. These are a series of small 'codes'
which, in a browser, display various objects. In the case of displaying
code, the code '<' actually displays as '<' and '>'
displays '>'. Each character entity has three parts: An ampersand(
&), a name and then a semi colon. So, to display your code, you
need to replace all the '<' and '>' with '<' and
'>'. There are two ways, I have found, which are the most
effective. Firstly, I highly recommend using this site: Simple Bits.
Simply enter your code in the top box, and it automatically changes the
code for display purposes. Or, the other method, is to use the Find and
Replace feature in your program.
Note: Each HTML Entity also has an 'ID', or an Entity Number. '<'
can also be typed as '<'. However, most people find it easier
to use names, because they are easier to remember. For example, the
following code:
<p>A paragraph. The tags will be displayed thanks to Entities! <p> © Creative Coding
Will display on the page like so:
<p>A paragraph. The tags will be displayed thanks to Entities!<p> � Creative Coding
To then style your code you should put and around
your display code. You will have noticed that SimpleCode, the first
link I posted, also does this for you. Then, to style, it's simply a
matter of using CSS. For a full list to HTML Entities check out this
link on W3Schools. http://www.w3schools.com/html/html_entities.asp
|