Reply
how to make some code visible?
Old 05-27-2006, 01:36 PM how to make some code visible?
Average Talker

Posts: 19
Hi
im trying to make a small peice of code visible on my site so visitors can copy and paste the code and display one of my images in message board or email signatures.
I had it in < textarea > box's and i liked that but only to find out that XHTML Strict doesnt allow < a > tags inside textarea tags so i cant validate with that (i need the images linking back to my site)

sooo i tried to use the code tag (dont know if thats a w3c standard or not??? the validator didnt mind it) but the HTML inside the code tag just works like normal html and it displays the image instead of the code.

help
emagine is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 05-27-2006, 03:25 PM Re: how to make some code visible?
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,945
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
<pre>
Your code here.
</pre>

The one thing you'll have to do with this is replace < signs with &lt; and > signs with &gt;.

http://www.searchenginefriendlylayou...footer_23.html

I use it here to present code samples and make them stand out.

Last edited by ADAM Web Design : 05-27-2006 at 03:26 PM.
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 05-27-2006, 03:30 PM Re: how to make some code visible?
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
Wireless Audio
Posts: 2,320
Name: Keith Marshall
Location: West Hartford, CT
You have to convert special html charactures into html char equivilant. Most modern text editors will do this for you.

To print this on the screen:
Code:
<b>The Image...</b>
<img src="images.example.gif" border="0" width="100" height="100" alt="The Image" />
You need this in your html:
Code:
&lt;b&gt;The Image...&lt;/b&gt;<br />
&lt;img src=&quot;images.example.gif&quot; border=&quot;0&quot; width=&quot;100&quot; height=&quot;100&quot; alt=&quot;The Image&quot; /&gt;
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 05-27-2006, 04:12 PM Re: how to make some code visible?
Average Talker

Posts: 19
thanks so much!
emagine is offline
Reply With Quote
View Public Profile
 
Old 05-29-2006, 03:30 AM Re: how to make some code visible?
Moldarin's Avatar
Extreme Talker

Latest Blog Post:
Keyword Density and Title Tags
Posts: 200
I have a text-to-HTML Entities converter you can use.
__________________
I do not share ad revenue.
Moldarin is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to how to make some code visible?
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.34841 seconds with 12 queries