Codes

PurpleCrow

Up-and-Coming Sensation
Joined
Oct 27, 2009
Messages
420
Reaction score
0
FP$
6
I want to place a HTML code for an image on my blog and forum but I want it to appear as a code, not the actual image so that people can copy and paste it. I've tried using <code></code> but it doesnt work... Any ideas of what tags I should be using??
 
Hmm it worked, but the code goes straight over the page, rather than sticking in the widget text box...
 
You could also try using the additional class attribute: <code class="code"> Some code.. </code>
 
Hey,

You can use &lt; and &gt;

Be sure to put it as:

Code:
&lt;p>example <strong>code</strong> here</p&gt;
 
None of those have worked... Grrr this is getting really irritating now! I just want a damn code on my blog! 🙁
 
Sorry, bad explanation.

&lt; will act as the opening < and &gt; will act as the closing >. So, your code should appear like:
Code:
&lt;a href="http://google.com">Google</a&gt;

Note there isn't any opening < and closing >. The are replaced by &lt; and &gt;

EDIT: it would be best if you code show us a portion of the code, mainly the start and end of the code.
 
you could do the <xmp></xmp> thing, but add some styling to you widget so it doesnot over flow

Code:
#your-widget-box{
overflow: hidden;
}

the only problem with this is that it will cut off part of the link. alternativly, you could make them widget box scroll instead

Code:
#your-widget-box{
overflow: auto;
}
 
This is the code -

<a href="http://s710.photobucket.com/albums/ww106/PersistentReality/?action=view&current=2kkbjt.png" target="_blank"><img src="http://i710.photobucket.com/albums/ww106/PersistentReality/2kkbjt.png" border="0" alt="Photobucket"></a>
 
Try posting it as dotDavid suggested:

Code:
&lt;a href="http://s710.photobucket.com/albums/ww106/PersistentReality/?action=view&current=2kkbjt.png" target="_blank">&lt;img src="http://i710.photobucket.com/albums/ww106/PersistentReality/2kkbjt.png" border="0" alt="Photobucket">&lt;/a>

The &lt; will be replaced by a < but will not function as an opening tag. You can even replace the closing tag aswell:

Code:
&lt;a href="http://s710.photobucket.com/albums/ww106/PersistentReality/?action=view&current=2kkbjt.png" target="_blank"&gt;&lt;img src="http://i710.photobucket.com/albums/ww106/PersistentReality/2kkbjt.png" border="0" alt="Photobucket"&gt;&lt;/a&gt;
 
Back
Top Bottom