Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    HTML Banner problem

    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>

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,801
    Thanks
    160
    Thanked 2,216 Times in 2,203 Posts
    Blog Entries
    1
    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?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,667
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    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
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #4
    New Coder
    Join Date
    Apr 2009
    Posts
    15
    Thanks
    0
    Thanked 1 Time in 1 Post
    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>

  • #5
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by SurFeR View Post
    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.

  • #6
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by abduraooft View Post
    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.

  • #7
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Excavator View Post
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •