SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: info tag?

  1. #1
    SitePoint Wizard johnn's Avatar
    Join Date
    Mar 2001
    Location
    Southern California, USA
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    info tag?

    I'm unable to use the info tag. It doesn't work. I'm not sure why.

    From Sitepoint Tribune 190:
    Here's an interesting tip from Tribuner Frank Pilone:

    Sometimes, you may want to define the meaning of a complex word or term on your site, without writing out the definition in a bracket or using JavaScript to create a new window which contians the definition.

    With HTML 4.0 you can create a message that appears above a word. It'd look very similar to the way visitors can see the ALT text of an image by hovering their mouse pointer over it.

    Here's the code that you would insert in your Cascading Style Sheet:

    info {
    text-decoration:underline;
    border-bottom: 1px dashed #00cc00;
    cursor: help;
    }

    Next, whenever you want to define the word, you would simply use the "title" attribute to describe the word. For example, if I wanted to let people know what Frank Pilone meant, I could do the following:
    <info title="my name">Frank Pilone</info>

    Whenever someone hovers their mouse over the word, the text "my name" would appear.

    Because people will likely not know that they can get more information about a word by hovering their mouse over the word, it probably makes sense to make the information appear when someone hovers their mouse over a "details" or "more informaiton" link. Here's what it could look like:

    Frank Pilone <info title="my name">(Details)</info>

  2. #2
    SitePoint Zealot t0m|ta's Avatar
    Join Date
    Mar 2002
    Location
    Madrid - Spain
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd never dare to contradict tectimes, but but I haven't been able to find <info></info> as an html tag in w3.org.

    Try this instead:

    <html>
    <head>
    <title>info</title>
    <style>
    .info {
    text-decoration:underline;
    border-bottom: 1px dashed #00cc00;
    cursor: help;
    }
    </style>

    </head>

    <body>



    <span class="info" title="This is my name">t0m|ta</span>
    </body>
    </html>

    I'm not sure that is what you want or what the article was triying to explain (i do not have the article), but it works

    Best regards

  3. #3
    SitePoint Zealot easyrew's Avatar
    Join Date
    Nov 2001
    Location
    Milton Keynes, UK
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by t0m|ta
    I'm not sure that is what you want or what the article was triying to explain (i do not have the article), but it works
    You're right - info doesn't appear in the specs - but may work depending on the author's browser. Your "alternative" solution is correct. Perhaps it should be printed in the next edition of the Tribune as a correction

    Rich
    If a man stands alone in the forest
    and there's no woman around to hear him,
    is he still wrong?
    w: www.EasyRew.com

  4. #4
    SitePoint Wizard Ian Glass's Avatar
    Join Date
    Oct 2001
    Location
    Beyond yonder
    Posts
    2,384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's a misprint, I think.

    Go ahead and use the method that t0m|ta suggested. You could also use the <DFN> tag instead of <SPAN>, as well. That may actually be more appropriate as far as document structure goes because <DFN> is more specific than the generic container, <SPAN>. :-)

    ~~Ian

  5. #5
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Or the word INFO could have been a placeholder meaning that you can use that technique on any tag within the HTML specification.
    Wayne Luke
    ------------


  6. #6
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There's Wayne for ya, always thinking of a deeper meaning for things.
    Last edited by mattjacob; Apr 6, 2002 at 02:01.

  7. #7
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Mea culpa

    Hi, Guys!

    Ok, even though this tip didn't appear in my newsletter, it was my fault. Matt asked me to look over it quickly and I changed the name of the tag it used from <accronym> to <info>.

    I had a bit of a brain burp, you see, and forgot that <accronym> was a valid HTML tag and just assumed the tip was using a custom XHTML tag. Based on this assumption, I decided that <accronym> wasn't a very appropriate name for the tag and changed it to <info>.

    So if you want to get the tip working in a jiffy, just change every occurrence of 'info' in the tip to 'accronym' (I'm about to go do this in the newsletter archives for that issue, myself).

    "But wait just a second," you may ask. "What's that you said about custom XHTML tags?"

    Well here's a little example that applies the tip to a custom tag called <sp:info>:
    Code:
    <html xmlns:sp>
    <head>
    <title> Custom tag example </title>
    <style type="text/css">
    sp\:info {
      text-decoration:underline; 
      border-bottom: 1px dashed #00cc00; 
      cursor: help;
    }
    </style>
    </head>
    <body>
    <p>"Racecar" is an example of a <sp:info title="A word r phrase that is spelled
    the same backwards and forwards.">palindrome</sp:info>.</p>
    </body>
    </html>
    As you can see, what I nelected to add to the tip was an XML namespace (in this case, 'sp').

    By adding xmlns:sp to the <html> tag, you're informing the browser that your document will contain custom tags, all of which will begin with 'sp:'. You can then assign any CSS attributes you like to your custom tags (note that a backslash is required before the colon in the CSS selector).

    Anyway, hope that clears it up for you! Apologies to Mr. Pilone, whose perfectly good tip I messed up. I'll be sure to feature a tip of XHTML custom tags in a future issue of the Tech Times.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference


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
  •