Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Help with HTML code

  1. #1
    Silver Member Vincent's Avatar
    Join Date
    Oct 2007
    Location
    Edenvale
    Posts
    337
    Thanks
    1
    Thanked 34 Times in 24 Posts

    Help with HTML code

    On a page where the HTML code is active how does one show the actual code without it converting it to the image.
    If the code is this:

    <a href="http://www.jaffyhead.com" target="_blank"><img src="http://www.jaffyhead.com/style_images/11197887682/logo4.gif"
    alt="jaffyHead.com – You're Not Alone"
    style="border:1"
    title="jaffyHead.com - a safe social & educational networking site"></a>



    and I want it to remain like this on the page, how do I go about it.
    Vincent Marino
    Maximising the sales value of your business!

    Business 24-Seven |MyBlog Twitter |facebook |Phat feesh & chips






  2. #2
    just me duncan drennan's Avatar
    Join Date
    Jun 2006
    Location
    Cape Town
    Posts
    2,642
    Thanks
    119
    Thanked 94 Times in 77 Posts
    I think the simplest way is to wrap it in the <code> </code> tags.

    There might be more advanced ways using CSS.
    [SIGPIC]Engineer Simplicity[/SIGPIC]
    Turn ideas into products | The Art of Engineering blog

  3. #3
    Site Caretaker Dave A's Avatar
    Join Date
    May 2006
    Location
    Durban, South Africa
    Posts
    20,980
    Thanks
    3,055
    Thanked 2,463 Times in 2,068 Posts
    Blog Entries
    12
    Did the code tag work, Vincent?

    If not, this the way the W3C Validator deals with the problem. They use this HTML code:

    Code:
    <pre>
          &lt;a href=&quot;http://validator.w3.org/check/referer&quot;&gt;&lt;img
              src=&quot;http://www.w3.org/Icons/valid-xhtml10&quot;
              alt=&quot;Valid XHTML 1.0!&quot; height=&quot;31&quot; width=&quot;88&quot; /&gt;&lt;/a&gt;
        &lt;/p&gt;
    </pre>
    which resolves into this on page display
    Code:
          <a href="http://validator.w3.org/check/referer"><img
              src="http://www.w3.org/Icons/valid-xhtml10"
              alt="Valid XHTML 1.0!" height="31" width="88" /></a>
    I know it looks messy, but it's less complicated than it looks. Basically you do some substituting.

    < = &lt;
    " = &quot;
    > = &gt;
    Last edited by Dave A; 30-Jan-08 at 03:00 PM.
    The trouble with opportunity is it normally comes dressed up as work.

  4. #4
    Silver Member Vincent's Avatar
    Join Date
    Oct 2007
    Location
    Edenvale
    Posts
    337
    Thanks
    1
    Thanked 34 Times in 24 Posts
    < = &lt;
    " = &quot;
    > = &gt;
    I did the substitution but it still wasn't right. So I did the thing I should have done in the first place. Phoned my IT guy.
    Time wasted: Vince 2hrs
    Russell: 2 minutes

    Next time phone the professionals
    Vincent Marino
    Maximising the sales value of your business!

    Business 24-Seven |MyBlog Twitter |facebook |Phat feesh & chips






  5. #5
    Site Caretaker Dave A's Avatar
    Join Date
    May 2006
    Location
    Durban, South Africa
    Posts
    20,980
    Thanks
    3,055
    Thanked 2,463 Times in 2,068 Posts
    Blog Entries
    12
    And the right way to do it was...?

    Please let it not be NOPARSE
    The trouble with opportunity is it normally comes dressed up as work.

  6. #6
    Site Caretaker Dave A's Avatar
    Join Date
    May 2006
    Location
    Durban, South Africa
    Posts
    20,980
    Thanks
    3,055
    Thanked 2,463 Times in 2,068 Posts
    Blog Entries
    12
    I've just tested this - works perfectly:
    Code:
    <p>&lt;a href=&quot;http://www.jaffyhead.com&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://www.jaffyhead.com/style_images/11197887682/logo4.gif&quot; 
    alt=&quot;jaffyHead.com – You're Not Alone&quot; style=&quot;border:1&quot; title=&quot;jaffyHead.com - a 
    safe social &amp; educational networking site&quot;&gt;&lt;/a&gt;</p>
    The trouble with opportunity is it normally comes dressed up as work.

  7. #7
    Platinum Member Chatmaster's Avatar
    Join Date
    Aug 2006
    Location
    Cape Town
    Posts
    1,065
    Thanks
    107
    Thanked 97 Times in 63 Posts
    Speaking of which, Vincent I had a look at your linking proposal. Do you mind if I rather link to you using a link text from my sites? If you do not mind, what would your main keyword be that you are targeting?

  8. #8
    Silver Member Vincent's Avatar
    Join Date
    Oct 2007
    Location
    Edenvale
    Posts
    337
    Thanks
    1
    Thanked 34 Times in 24 Posts
    Quote Originally Posted by Chatmaster View Post
    Do you mind if I rather link to you using a link text from my sites? If you do not mind, what would your main keyword be that you are targeting?
    No problem... key word(s) grade 10, grade 11, grade 12, education, educational networking site... something along those lines.
    Let me know when you're done.
    Vincent Marino
    Maximising the sales value of your business!

    Business 24-Seven |MyBlog Twitter |facebook |Phat feesh & chips






  9. #9
    Silver Member Vincent's Avatar
    Join Date
    Oct 2007
    Location
    Edenvale
    Posts
    337
    Thanks
    1
    Thanked 34 Times in 24 Posts
    Quote Originally Posted by Dave A View Post
    And the right way to do it was...?
    I actually have no idea... but this is what the code looks like.
    Code:
    <br/><br/>
    &lt;a href="http://www.jaffyhead.com" target="_blank"&gt;
    &lt;img src="http://www.jaffyhead.com/style_images/11197887682/logo_small.gif" 
    alt="jaffyHead.com – You're Not Alone" 
    style="border:1"  
    title="jaffyHead.com - a safe social & educational networking site"&gt;&lt;/a&gt;
    <br/><br/>
    Tried it with <p>, but it wasn't picking up <p>

    Guys thanks for the input, know going to try <Code>
    Vincent Marino
    Maximising the sales value of your business!

    Business 24-Seven |MyBlog Twitter |facebook |Phat feesh & chips






  10. #10
    Site Caretaker Dave A's Avatar
    Join Date
    May 2006
    Location
    Durban, South Africa
    Posts
    20,980
    Thanks
    3,055
    Thanked 2,463 Times in 2,068 Posts
    Blog Entries
    12
    That should produce the same results - although I had tidied out all the new lines for more compact code. Just a note on the br tag

    For HTML, the use is <br>
    For XHTML, the use is <br />

    If you are using XHTML, you should also add a trailing / at the end of the img tag.

    Not the end of the world. Browsers are very forgiving.
    The trouble with opportunity is it normally comes dressed up as work.

Page 1 of 2 12 LastLast

Similar Threads

  1. Blogger's Code of Conduct
    By Dave A in forum Technology Forum
    Replies: 3
    Last Post: 18-Apr-07, 11:33 AM

Did you like this article? Share it with your favourite social network.

Did you like this article? Share it with your favourite social network.

Posting Permissions

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