4 Replies - 1189 Views - Last Post: 21 October 2006 - 07:01 AM

#1 jt3  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 26-September 06

Showing Text instead of photo

Posted 20 October 2006 - 05:42 AM

I am creating a website for myspace layouts and quotes and that type thing. I have made a small quote picture, and made the code to put it onto myspace that works. Now I am trying to put the code (as text) onto my site, so that others can copy it and put it onto their myspace. The problem is, when you click for the code, it comes up the picture instead of the code in text. How can I prevent this?

This is the code the way I currently have it:
<br><center><a href="http://www.freewebs.com/sosweetcreations/" target=_blank><img src="http://i112.photobucket.com/albums/n166/layoutsbyjt/24c5d198.jpg" border="0" alt="Photobucket - Video and Image Hosting"></a>

Is This A Good Question/Topic? 0
  • +

Replies To: Showing Text instead of photo

#2 the_hangman  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 14
  • View blog
  • Posts: 602
  • Joined: 18-January 06

Re: Showing Text instead of photo

Posted 20 October 2006 - 06:47 AM

I believe wrapping the text you want to see as text in <textarea> and </textarea> should do it
Was This Post Helpful? 0
  • +
  • -

#3 mlindi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 20-October 06

Re: Showing Text instead of photo

Posted 20 October 2006 - 12:26 PM

View Postthe_hangman, on 20 Oct, 2006 - 06:47 AM, said:

I believe wrapping the text you want to see as text in <textarea> and </textarea> should do it


IIRC, on MySpace you can also present code snippets by preceding with <z>.
Was This Post Helpful? 0
  • +
  • -

#4 rockstar_  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 32
  • View blog
  • Posts: 189
  • Joined: 16-October 06

Re: Showing Text instead of photo

Posted 20 October 2006 - 01:35 PM

View Postjt3, on 20 Oct, 2006 - 05:42 AM, said:

I am creating a website for myspace layouts and quotes and that type thing. I have made a small quote picture, and made the code to put it onto myspace that works. Now I am trying to put the code (as text) onto my site, so that others can copy it and put it onto their myspace. The problem is, when you click for the code, it comes up the picture instead of the code in text. How can I prevent this?

This is the code the way I currently have it:
<br><center><a href="http://www.freewebs.com/sosweetcreations/" target=_blank><img src="http://i112.photobucket.com/albums/n166/layoutsbyjt/24c5d198.jpg" border="0" alt="Photobucket - Video and Image Hosting"></a>

Try using the html entities for the tags instead of the tag itself. Then, the code will render, but people can still copy and paste. So instead of <html> you have <html>

rockstar_
Was This Post Helpful? 0
  • +
  • -

#5 Arbitrator  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 51
  • View blog
  • Posts: 530
  • Joined: 26-January 05

Re: Showing Text instead of photo

Posted 21 October 2006 - 07:01 AM

You can prevent HTML from being parsed by using character entities to replace the characters used to open tags; in other words, use &lt; for the less-than sign. You can also use the hexideximal form if preferred: &#x003c; or &#x3c; for short. Thus your HTML would look like this:

&lt;br>
&lt;center>
  &#lt;a href="http://www.freewebs.com/sosweetcreations/" target="_blank">
    &lt;img src="http://i112.photobucket.com/albums/n166/layoutsbyjt/24c5d198.jpg" border="0" alt="Photobucket - Video and Image Hosting">
  &lt;/a>
&lt;/center>


Note that it's bad practice to use the deprecated center element and border attribute. The target attribute is also deprecated but some authors still insist on controlling their user’s browsing preferences; the user can open a link target in a new window or tab without author intervention. Alternate text should also be used correctly. Anyway, use CSS instead:

CSS:
div {
  text-align: center;
  }
a img {
  border-width: 0;
  }


HTML:
<div>
  <a href="http://www.freewebs.com/sosweetcreations/">
    <img alt="There is no past tense of love; either you do or you never did." width="292" height="108" src="http://i112.photobucket.com/albums/n166/layoutsbyjt/24c5d198.jpg">
  </a>
</div>


I suppose the good/bad practice thing is sort of moot though considering how poor MySpace’s code is.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1