Html 如何在悬停时获得第二行要隐藏和显示的文本?仅CSS

Html 如何在悬停时获得第二行要隐藏和显示的文本?仅CSS,html,css,Html,Css,我尝试过使用文本缩进,但这只适用于第一行,如果我使用边距,文本根本不显示,我如何才能使文本在悬停时显示?这是密码 HTML: 是小提琴如果您只想隐藏整个标题,直到用户将鼠标悬停在图形上,请使用: .annotated figcaption { display: none; } .annotated:hover figcaption { display: block; } 如果希望标题始终显示,而其他链接仅在悬停时显示,请使用: .annotated figcaption a

我尝试过使用文本缩进,但这只适用于第一行,如果我使用边距,文本根本不显示,我如何才能使文本在悬停时显示?这是密码

HTML:


是小提琴

如果您只想隐藏整个标题,直到用户将鼠标悬停在图形上,请使用:

.annotated figcaption {
    display: none;
}

.annotated:hover figcaption {
    display: block;
}
如果希望标题始终显示,而其他链接仅在悬停时显示,请使用:

.annotated figcaption a {
    display: none;
}

.annotated figcaption a:first-child {
    display: inline;
}

.annotated:hover figcaption a {
    display: inline;
}

你是想让所有的链接都显示出来,然后当你悬停在div上时隐藏“Item1”吗?我想让所有的文本都隐藏起来,然后当我悬停在div上时所有的东西都显示出来谢谢,第一个很完美,我把它弄得太复杂了。
.annotated figcaption {
    display: none;
}

.annotated:hover figcaption {
    display: block;
}
.annotated figcaption a {
    display: none;
}

.annotated figcaption a:first-child {
    display: inline;
}

.annotated:hover figcaption a {
    display: inline;
}