Forums

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

Home Forums CSS img:hover not working

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #36452
    balushyno1
    Participant

    Hello all, i want to create a caption on an Image here is the code,

    blockquote p {
    width:330px;
    background-color: hsla(0,0%,0%,.7);
    padding:10px;
    color:white;
    }
    blockquote img {
    cursor:pointer;
    }
    blockquote img:hover p {
    opacity:0.5;

    but its not working i want hover on the image the with css transitions i want to create a fadein caption effect,

    So html is like,

     


    test test

    but for the testing purposes i declared img:hover p { its not working what im doing wrong?

    #95893
    Paulie_D
    Member

    You might try the sibling selector.

    blockquote img:hover+p {
    opacity:0.5;

    See: http://jsfiddle.net/Paulie_D/erm9e/

    #95905
    balushyno1
    Participant

    Paulie D it worked thanx;)

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