Html CSS中图像下文本的悬停效果

Html CSS中图像下文本的悬停效果,html,css,hover,Html,Css,Hover,我无法对图像下的文本或图像本身应用悬停效果 以下是代码(CSS): 如何应用一些悬停效果?在标记中设置文本或使用JQuery $("p").hover( function () { } ); 图像上的悬停效果 $("#photo").hover( function () { } ); 像这样 CSS #hover { display: none; } #image:hover + #hover { display: block; } 我没有看

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

以下是代码(CSS):

如何应用一些悬停效果?

标记中设置文本或使用JQuery

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

}
);
图像上的悬停效果

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

    }
    );
像这样

CSS

#hover {
    display: none;
}

#image:hover + #hover {
    display: block;
}

我没有看到任何
:悬停在这里你应该上传你的相关代码,我的意思是,我不知道把它放在哪里。我创建了一个div,但它不起作用。很抱歉,我们不允许使用javascript。如果您需要文本的悬停效果,请尝试。为什么??你能告诉我发生了什么事吗?告诉我当你将鼠标悬停在文本上时,你希望文本是什么>文本应该有下划线并有背景色。你能做一点吗?它成功了!非常感谢。现在我所要做的就是使其可点击。我可以使用带有文本的.img:hover{text decoration:underline;background color:#ccc;}作为链接、已访问和活动吗?
.img-with-text {
    text-align: justify;
    width: 200px;
    display:block;
}

.img-with-text:hover {
    text-decoration:underline;
    background-color:#ccc;
}
#hover {
    display: none;
}

#image:hover + #hover {
    display: block;
}