How would I show raw html inside of a text box?

2008-08-29 1:21 am
I want to show the html for an image and place it inside of a text box so other people can use the code to place the image on their page. How would I do that?

回答 (8)

2008-08-29 1:36 am
✔ 最佳答案
Try this...

Use Entities, instead of <, ", and >, because I don't think they will work, they will just show up HTML code. Entities can be found here. http://www.w3schools.com/html/html_entities.asp

<textarea rows="5" cols="30">
<img src="yourimagesource.type">
</textarea>
2016-05-26 12:51 pm
<textarea>HTML CODE HERE</textarea>
2008-08-29 8:57 am
<form>
<textarea cols="48" rows="3">
<img width="100"src="your codes inside the textarea tags but these cannot include textarea tags"height="100">
</textarea>
</form>

does this make sense?
also be sure to include height and width tags it makes loading faster Also arranging these elements in the order of: width, src, height will make it more quickly interpreted by Internet Explorer!

參考: http://www.draac.com learn alot very easily!
2008-08-29 1:42 am
you use <xmp></xmp> tags. but they are spacey. it removed hte next for a text box...

or here is the coed for a text box.

<input id='box name' type='text' style='width: (WIDTH NUMBER)px; height: (HEIGHT NUMBER)px;'value='madd text here.'><br>
2008-08-29 1:40 am
Here is the raw code:
<textarea>"insert picture html here"</textarea>
參考: HTML book
2008-08-29 1:37 am
Use the appropriate html entities (http://w3schools.com/tags/ref_entities.asp) so:

< becomes &lt;
> becomes &gt;

you'll write & lt; in the page's code, but it will display as < on the page.

So for a whole image tag you'd end up with something like

&lt;img src=&quot;path&quot;&gt;

which then displays as:
<img src="path">

2008-08-29 1:35 am
Place <textarea> tags around the code. You can further specify the height and width of the text box using col="#" and row="#" inside the <textarea> tag.

ie. <textarea col="10" row="10">[code]</textarea>
2008-08-29 1:30 am
put the code in notepad then uplaod to photobucket that notepad doc(name it htmlcode.jpg so photobucket thinks its a pic)thenyou know the rest
參考: Me


收錄日期: 2021-05-03 14:00:32
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20080828172122AAGG7sx

檢視 Wayback Machine 備份