...

View Full Version : HTML Banner problem



highlander2k
04-04-2009, 09:17 AM
I am beginner in html and the problem is when I send an html code as a text message it gets executed which I don't want. The html code is for a banner.
I tried replacing <> with &lt and &gt respectively and this solves the problem but when the others copy-paste this code to their webpages it shows only the code as text and no image is displayed. However it works fine on my own page. The image used is public and no firewall/proxies etc. are used.

This is the code:

<a href="website">
<img src="image url">
</a>

abduraooft
04-04-2009, 09:27 AM
I am beginner in html and the problem is when I send an html code as a text message it gets executed which I don't want. Are you posting this to your website?

Excavator
04-04-2009, 04:54 PM
Hello highlander2k,
That image is surround by a href so it's a link and would be "executed" as a link if you clicked on it.
Have a look at how to use the img tag without making your image a link - http://www.w3schools.com/tags/tag_IMG.asp

SurFeR
04-04-2009, 10:39 PM
hi,
you have to replace "<" to "&lt;" (not just &lt)

e.g.
&lt;a href="http://www.codingforums.com">&lt;img src="http://www.codingforums.com/img/logo.gif"> &lt;/a>

highlander2k
04-05-2009, 07:08 PM
hi,
you have to replace "<" to "&lt;" (not just &lt)

e.g.
&lt;a href="http://www.codingforums.com">&lt;img src="http://www.codingforums.com/img/logo.gif"> &lt;/a>

I was aware of the ; but when I use &lt; then the code executes in the sent message and image gets displayed which is not desired. However, if I use &lt or &gt without the ; then the code is sent as it is (as text and doesn't execute, desirable),,, but... when other people ,who receive this code in their inbox, try to copy-paste the tag in their website then only the code is displayed as text and doesn't execute.
I think the catch is in this &lt and &gt only but I am no expert in html and am in the learning stage so please suggest.

highlander2k
04-05-2009, 07:15 PM
Are you posting this to your website?

I post this to my profile page e.g. like facebook then it works fine ie banner displays fine. But when I send the code to others using &lt/&gt then they are unable to use this html banner because the code doesn't run on their profile pages and shows only as plain text.

highlander2k
04-05-2009, 07:24 PM
Hello highlander2k,
That image is surround by a href so it's a link and would be "executed" as a link if you clicked on it.
Have a look at how to use the img tag without making your image a link - http://www.w3schools.com/tags/tag_IMG.asp

Yes, I want the image to link to a particular webpage, it is a banner. The code works fine on my own profile page eg in facebook, but when send it to other people using &lt &gt (so as to send the code to them for copy-pasting into their profiles) the code doesn't execute to show the image but shows as plain text.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum