显示框内的HTML代码,如雅虎html邮件 [英] show html code inside box like yahoo html messages

查看:75
本文介绍了显示框内的HTML代码,如雅虎html邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我会在代码中使用类似邮件我的旧代码,我想我是如此

 < div class =mydivstyle =border:1px#000 solid> 
用户代码
< / div>

这里的问题是,如果用户的html代码是以< / div> ; 我自己的div将被关闭,其余的代码将显示在我的div之外!

那么,我该如何专业地完成这项工作?我尝试搜索!



谢谢

解决方案

试试这个:

 < div class =mydivstyle =border:1px#000 solid> 
< textarea style =width:100%; height:120px; border:2px solid black; padding:4px;>
用户代码
< / textarea>
< / div>


I want view user html code inside box like Gmail,Yahoo html messages.

I will use code in something like mail my old code and I think I am so stupid!

<div class="mydiv" style="border:1px #000 solid">
THE USER CODE
</div>

The problem here is if user html code is starts with </div> my own div will be closed and rest code will show outside my div!

So, how i can done this job professionally? I tried searching!

thank you

解决方案

Try this:

<div class="mydiv" style="border:1px #000 solid">
<textarea style="width:100%;height:120px;border:2px solid black;padding:4px;">
THE USER CODE
</textarea>
</div>

这篇关于显示框内的HTML代码,如雅虎html邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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