0

我无法对图像下方的文本或图像本身应用悬停效果。

这是代码(CSS):

#photo {
    float: left;
    width: 10px;
    margin-left: 35px;
    text-align: justify;
}

.img-with-text {
    text-align: justify;
    width: 200px;
}



.img-with-text img{
    display: block;
    margin: 0 auto;
}

如何应用一些悬停效果?

4

3 回答 3

1
.img-with-text {
    text-align: justify;
    width: 200px;
    display:block;
}

.img-with-text:hover {
    text-decoration:underline;
    background-color:#ccc;
}
于 2013-08-17T07:45:26.443 回答
1

像这样

演示

CSS

#hover {
    display: none;
}

#image:hover + #hover {
    display: block;
}
于 2013-08-17T07:48:43.787 回答
0

<a href="#">your text</a>在标签中设置文本或使用 JQuery

$("p").hover(
function () {

}
);

悬停在图像上的效果。

$("#photo").hover(
    function () {

    }
    );
于 2013-08-17T07:38:25.580 回答