如何在html页面中包含html文件代码 [英] how to include html file code in html page

查看:439
本文介绍了如何在html页面中包含html文件代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在html页面中包含html文件?

How to include html file in html page?

推荐答案

你必须使用HTML编码:它会改变

You have to use HTML encoding: it changes
<a href="...">text</a>

进入

Into

&lt;a href="..."&gt;text&lt;/a&gt;

浏览器将其自动转换回可读形式。



你究竟是怎么做的,取决于你写的网站是什么! :笑:

但谷歌应该可以提供帮助:只需尝试HTML Encode TheLanguageYouAreWorkignIn

Which is automaticaly converted back into the readable form by the browser.

Exactly how you do that will depend on what you are writing your website in! :laugh:
But Google should be able to help: just try "HTML Encode TheLanguageYouAreWorkignIn"


除了OriginalGriff关于编码的答案,请看看前置元素 [ ^ ],它允许您按原样编写代码。所以,例如(像CodeProject上的这个例子),你可以写这个



In addition to OriginalGriff's answer about encoding, have a look at the pre element[^] in HTML, which allows you to write code as it is. So, for example (like this example on CodeProject), you can write this

<pre>
   <p>This is a paragraph.</p>
</pre>





它将呈现为,





It will be rendered as,

<p>This is a paragraph.</p>





它将维护标签,并且浏览器不会呈现它们。



It will maintain the tags, and they won't be rendered by the browser.


这篇关于如何在html页面中包含html文件代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆