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

Home Forums CSS [Solved] Hover div change p colours?

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #175686


    Can’t get my head around this,
    I have a div that contains two both of which have a colour styled to them. I’d would like to when hovering have the div change both to have matching colours.

    it seems so easy, but here it goes:

    .section a:hover { color:green; }
    p.title { color:black; }
    p.desc { color:green; }
    <a href="http://">
                <div class="section">       
                                <p class="desc">Publication</p>
                                <p class="title">2014</p>     

    What did I miss?

    .section a:hover

    This says that anchor links in .section should be green when hovered. But since there are no links in there nothing will happen. (There is a link WRAPPING .section though.)

    I’m not really sure what you’re trying to do exactly though, so I can’t come up with a proper solution.

    Is this what you meant?


    That’s exactly what I was looking for. Appreciate the help Senff.

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