2011-07-20 24 views

回答

14

您需要HTML轉義你的文字,你可以很容易分辨,如果你看一下這個非常網頁的HTML源代碼:

<div class="post-text"> 
    <p>I have some HTML that I would like to make it appear like the code option here</p> 

    <pre><code>&lt;a href="#"&gt;test&lt;/a&gt; 
    </code></pre> 

    <p>How can I do it?</p> 
</div>    
6

你需要編碼尖括號等,以在頁面上顯示。

可以在HTML手動完成此操作:

&lt;a href="#"&gt;test&lt;/a&gt; 

其中:

&lt; = < 

&gt; = > 

對於其他字符這裏的字符代碼表:http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references

+0

「HTML代碼」 和「HTML號碼「必須是標記桌子最無知的方式 - 多麼可怕的網站。即使[Wikipedia](http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references)也是一個更好的參考... –

+0

謝謝Kerrek。我用這個更好的參考替換了鏈接。 –

相關問題