SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: displaying tags

  1. #1
    Get my greedy down dotJoon's Avatar
    Join Date
    Apr 2003
    Location
    daejeon, South Korea
    Posts
    2,207
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    displaying tags

    Code:
    code
    
    <b>I am a boy</b>
    
    browsing result
    
    
    I am a boy
    The above code produces the browsing result above.


    But, I like to disply tags instesd of executing them.

    The following is one of my trial but I didn't get my target browsing result.

    Code:
     trial code
    
    <pre>
    <b>I am a boy</b>
    </pre>

    The following would-be code doesn't work correctly, but I hope it will show you what I want.

    Code:
    would-be code
    
    <displaying tag from here>
    <b>I am a boy</b>
    </displaying tags to here>
    
    target browsing result
    
    <b>I am a boy</b>
    Can I get my target result above with your help?

  2. #2
    SitePoint Wizard aaron.martone's Avatar
    Join Date
    Feb 2003
    Location
    Florida, USA
    Posts
    2,322
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Use &lt; for <
    Use &gt; for >
    Use &quot; for "
    Use &amp; for &

    ie, your page code would look like

    Code:
      &lt;strong&gt;This is bold, but we don't use the &quot;b&quot; tag anymore&lt;/strong&gt;
    And would display as

    <strong>This is bold, but we don't use the "b" tag anymore</strong>

  3. #3
    Get my greedy down dotJoon's Avatar
    Join Date
    Apr 2003
    Location
    daejeon, South Korea
    Posts
    2,207
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by aaron.martone
    Use &lt; for <
    Use &gt; for >
    Use &quot; for "
    Use &amp; for &

    ie, your page code would look like

    Code:
      &lt;strong&gt;This is bold, but we don't use the &quot;b&quot; tag anymore&lt;/strong&gt;
    And would display as

    <strong>This is bold, but we don't use the "b" tag anymore</strong>
    sorry... replacing the opening tag and the closing tag into &lt; &&gt; is not what I want.

    What I want might be a pair of tags.
    Any help?

  4. #4
    SitePoint Wizard aaron.martone's Avatar
    Join Date
    Feb 2003
    Location
    Florida, USA
    Posts
    2,322
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Then unless you can describe a little better what you mean, I'm 110% lost. "A pair of tags is what you want?" I don't understand that at all.

  5. #5
    Get my greedy down dotJoon's Avatar
    Join Date
    Apr 2003
    Location
    daejeon, South Korea
    Posts
    2,207
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by aaron.martone
    Then unless you can describe a little better what you mean, I'm 110% lost. "A pair of tags is what you want?" I don't understand that at all.
    If you don't understand my talking, I consider it's all my fault.

    Sorry, I have some problems in speaking in English because I've never lived in English speaking country.


    Code:
    code
    
    I <font color='red'>am</font> a <b>boy</b>.
    
    browsing result
    
    I am a boy.

    I like to find a tag which makes "all tags and text" inside the tags, displaying them instead of executing it.


    Code:
    would-be code
    
    <displaying all tags from here>
    
    I <font color=red>am</font> a <b>boy</b>
    
    
    </displying all tags to here>
    
    
    target browsing result
    
    I <font color='red'>am</font> a <b>boy</b>.

  6. #6
    SitePoint Wizard bronze trophy Tyssen's Avatar
    Join Date
    Oct 2005
    Location
    Brisbane, QLD
    Posts
    4,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is no tag that will do that. You can wrap your code in <code> but that just describes the contents, not how it appears on screen. You need to change the < and > in your code to &lt; and &gt; as Aaron suggested.

  7. #7
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by aaron.martone
    Use &quot; for "
    That's only necessary within an attribute value enclosed in double quotes, though.

    Aaron is completely right. If you want to display those characters that have special meaning in HTML markup, you must escape them using entity references (like &#38;lt;) or numeric references (like &#38;#60;).

    In XML (and thus XHTML served as XML), you can also use CDATA sections. No HTML browser supports those, AFAIK.
    Birnam wood is come to Dunsinane


Bookmarks

Posting Permissions

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