Results 1 to 4 of 4

Thread: grow p onmouseover

  1. #1
    Join Date
    Aug 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default grow p onmouseover

    I've got a list of items with with associated details. Rather than do a regular #name link to send the user somewhere else to view the details, I thought it would be good to just have the details with the name, and grow the <p> when the user hovers.

    it seems intuitive that the following arrangement would work:

    CSS
    a.grow {height=20px;overflow=hidden;}
    a.grow:hover {overflow=visible;}

    HTML
    <a class="grow">Item 1<br />
    details details<br />
    more details</a>

    This arrangement should show just "Item 1" (due to the restricted height) until the user hovers, and then the overflow property should change to 'visible', thus revealing the details...

    I imagine I'm doing something silly like putting breaks in <a>, but I was hoping someone could point me in the right direction.

    Thanks for the help.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I imagine I'm doing something silly like putting breaks in <a>
    No, you're doing something silly like using = instead of : in CSS
    Also, a static 20px isn't a good idea, since not everybody's fonts will be exactly 20px in height. 1.5em is usually a good estimate.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Aug 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ok, I was going to toss myself off of a building out of shame, but in my defense, I was not actually using = in the code.

    Oh, I spoke too soon. I did have a.grow (not) matched with a.grows:hover in the other link. An extra s was the problem.

    Well, thanks for fixing that. I'm going to toss myself off of a building now. I hope someone else can benefit from your great advice.

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Heh, whoops
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •