Reputation: 3757
I want to show some code for some documentation. But whenever I try, the browser actually renders it as HTML rather than as text.
How do I stop this?
<pre>
<code class="html">
<div class="alert-wrap g--5">
<input type="checkbox" id="alert-check">
<label for="alert-check">CLOSE</label>
<div class="alert card">
<p>Surface rules! That is all.</p>
</div>
</div>
</code>
</pre>
Upvotes: 2
Views: 857
Reputation: 3625
You can use online converters.
<pre>
<code class="html">
<div class="alert-wrap g--5">
<input type="checkbox" id="alert-check">
<label for="alert-check">CLOSE</label>
<div class="alert card">
<p>Surface rules! That is all.</p>
</div>
</div>
</code>
</pre>
Online converters
http://www.accessify.com/tools-and-wizards/developer-tools/quick-escape/default.php
Upvotes: 0
Reputation: 250942
You can encode your HTML to avoid it being interpreted as HTML...
<pre>
<code class="html">
<div class="alert-wrap g--5">
<input type="checkbox" id="alert-check">
<label for="alert-check">CLOSE</label>
<div class="alert card">
<p>Surface rules! That is all.</p>
</div>
</div>
</code>
</pre>
Upvotes: 3