Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS CSS display hidden text on rollover

  • This topic is empty.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #33677
    sailors1112
    Member

    Hello all,

    I’ve been hitting my head against the wall for a couple of days with this.

    http://eigobento.com/vocabulary.html

    I’ve been trying to get the steps to be hidden (and the table collapsed) until the mouse rolls over “More Info.” I want the table to shrink and grow when the extra text is hidden/unhidden.

    Any help would be much appreciated. Honestly, I’m a total newb, so please explain clearly.

    Thank you very much!

    #84108
    Paulie_D
    Member

    I know it probably won’t help but I wouldn’t be using a table here. Divs or a list would make more sense as you can target them directly in your CSS.

    #84111

    I’m not quite sure what you mean by table being collapsed but to make the steps appear when you hover over “More info” you need to add an ID to the “Read more” paragraph and the steps paragraph and then add this to your CSS:

    /* This hides the steps by default */
    #steps {
    display: none;
    }

    /* Means that when the element with an ID of 'read-more' is hovered then all of its siblings with an ID of 'steps' should be shown */
    #read-more:hover ~ #steps {
    display: block;
    }

    You can remove ‘class=”hidden”‘ from the two paragraphs

    Hope this helps

    #84120
    sailors1112
    Member

    @Paulie_D… you’re right I’m sure, I’m just really bad at this.


    @Carlbennettnz
    … thank you for the advice. I edited it like you said but I’m getting nothing on hover. I thought maybe there was something else weird that was messing it up, but even when I made a test page it isn’t working:

    http://eigobento.com/hovertest2.html

    http://eigobento.com/vocabulary.html

    Can you tell what I did wrong? I haven’t been able to figure it out -_-;

    Thanks again!

    #84125
    sailors1112
    Member

    Thank you very much! I’m beginning to see how divs work. I think I can work with this…

    ^_^

    #84126
    jamygolden
    Member

    @sailors1112 your examples work 100%… In Everything other than Chrome and Safari. So it works in IE7+, Firefox and Opera.

    #moreinfo:hover + #steps{display: block;}

    That will work in Chrome and Safari too. So you were right, it’s just a webkit bug.

    #84128
    sailors1112
    Member

    @Jamy_za… that’s for pointing that out! It works now!!! ;_; Thank you I’m on a mac using chrome so I never noticed…

    Although, I just realized I don’t like the roller over 100%

    Is there a command that will get it to do the same thing (open/close) with a click instead?

    #84131
    sailors1112
    Member

    @Paulie_D… those are goods points. I’m just worried about the fact that the text disappears really easily and if you have to scroll to read it you have to go back and forth… It’s a bit difficult and annoying : /

    But, I’m also worried about JS. That’s probably waaaaaay over my head hahaha

    #84133
    jamygolden
    Member

    There is, but it won’t be supported by IE8 and lower.

    More Info
    Whatever

    #steps:target{display: block}
    #84134
    sailors1112
    Member

    Thanks everyone! This has all been really helpful and informative!

    I feel like I learned a lot (^-^)V

    #84659
    sailors1112
    Member

    Finished product!

    http://www.eigobento.com

    Thanks again everyone for your help!

Viewing 11 posts - 1 through 11 (of 11 total)
  • The forum ‘CSS’ is closed to new topics and replies.