添加链接以显示在textarea框内 [英] Add link to appear inside the textarea box
本文介绍了添加链接以显示在textarea框内的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有一种方法可以让用户在textarea中输入一个URL,并让链接实际显示并作为超链接工作?
例如:
< textarea name =Miscell cols =110rows =5wrap =Virtualclass =noborder>
blah blah blah =
< a href =http://www.googel.com/> Google< / a>
等等等等等等
< / textarea>
没有链接显示:我能做什么?
我没有创建该网站:我只是想用Firebug来改变它。 不要在文本区域放置任何活动链接。文本区域被设计为仅显示文本内容。而不是你可以使用div和使用一些CSS使div作为文本区域。
例如:(不是我的代码)
< style type =text / css>
#box {
width:400px;
margin:0 auto;
溢出:auto;
border:1px solid#0f0;
padding:2px;
text-align:justify;
背景:透明;
}
< / style>
HTML ...
< body>
< div id =box>
< h4>我的连结< / h4>
< a href =>•段落One Here< / p>< p>< a href =外部链接的URL路径title =鼠标移动描述>链接文字描述< / a>< / p>
< p>< a href =外部链接的URL路径title =鼠标移动描述>链接文字说明< / a>< / p>
< p>< a href =外部链接的URL路径title =鼠标悬停说明>链接文字说明< / a>< / p>
< p>< a href =外部链接的URL路径title =鼠标移动描述>链接文字说明< / a>< / p>
< p>< a href = 鼠标移动描述>连结文字说明< / a>< / p>
< / div>
Is there a way that a user can enter a URL in a textarea and have the link actually display and work as a hyperlink?
For example:
<textarea name="Miscell" cols="110" rows="5" wrap="Virtual" class="noborder">
blah blah blah=
<a href="http://www.googel.com/">Google</a>
blah blah blah
</textarea>
No link is displayed: what can I do?
I'm not creating that site: I'm just trying to change it using Firebug.
解决方案
You can't place any 'Active Link' inside a text area. A text area is designed to displaying text only content. Instead of that you can use div and using some css make div as a text area.
Eg: (Not my code)
<style type="text/css">
#box {
width: 400px;
margin: 0 auto;
overflow: auto;
border: 1px solid #0f0;
padding: 2px;
text-align: justify;
background: transparent;
}
</style>
HTML...
<body>
<div id="box">
<h4>My Links</h4>
<a href=">• Paragraph One Here.</p><p><a href="URL path to external link" title="Mouseover Description">Link Text Description</a></p>
<p><a href="URL path to external link" title="Mouseover Description">Link Text Description</a></p>
<p><a href="URL path to external link" title="Mouseover Description">Link Text Description</a></p>
<p><a href="URL path to external link" title="Mouseover Description">Link Text Description</a></p>
<p><a href="URL path to external link" title="Mouseover Description">Link Text Description</a></p>
</div>
这篇关于添加链接以显示在textarea框内的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文