I'm trying to build an HTML element library (like Twitter Bootstrap) and I'd like to have a live version of the element (like a button, for example) next to the proper code markup.
I'm trying to use Prettify to display something like <button>Button</button>
, but it doesn't seem to be working.
Here's what I'm seeing when I view the page:
Question: What am I doing wrong here?
Here's the relevant HTML:
<html>
<head>
<title>Common HTML Library</title>
<link type="text/css" rel="stylesheet" href="common.css" />
<link type="text/css" rel="stylesheet" href="prettify/prettify.css" />
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="prettify/prettify.js"></script>
<script type="text/javascript">
$(document).ready(function() {
prettyPrint();
});
</script>
</head>
<body>
<h1>Buttons</h1>
<table>
<thead>
<tr>
<th>Element</th>
<th>Description</th>
<th>Markup</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<button>Button</button>
</td>
<td>Standard Button</td>
<td>
<code class="prettyprint">
<button>Button</button>
</code>
</td>
</tr>
<tr>
<td>
<button class="primary">Button</button>
</td>
<td>Primary Button</td>
<td>
<code class="prettyprint">
<button class="primary">Button</button>
</code>
</td>
</tr>
<tr>
<td>
<button disabled="disabled">Button</button>
</td>
<td>Disabled Button</td>
<td>
<code class="prettyprint">
<button disabled="disabled">Button</button>
</code>
</td>
</tr>
</tbody>
</table>
</body>
</html>
EDIT:
I tried setting the language and using <pre>
like this and got the following:
<pre class="prettyprint lang-html">
<button>Button</button>
</pre>