如何使HTML标签原样显示出来
方法一:
将HTML代码嵌入到<script type='text/html' style='display:block'></scipt>
中
<script type='text/html' style='display:block'> <input type="text" /> </scipt>
示例代码:
<body> <pre> <script type="text/html" style="display: block;"> <div> 哈哈哈 </div> <h4>dfdfd</h4> </script> </pre></body> 方法二:
有时候想让一些html的标签不被浏览器解释翻译,直接原样的显示出来,这时可以在想要显示的代码的外面加上<xmp></xmp>,这样<xmp>标签里面的内容将原封不动的显示出来。
例如
<xmp>
<table>
<tr>
<th width="140">a</td>
<th width="140">b</td>
<th width="140">c</td>
</tr>
</table>
</xmp>