CSS-将鼠标悬停在元素E2上时显示元素E1
这是一个奇怪的问题,但我得到了一个html文件,它有B标签的标题和单独的ol标签的名单 像这样的CSS-将鼠标悬停在元素E2上时显示元素E1,css,html,hover,Css,Html,Hover,这是一个奇怪的问题,但我得到了一个html文件,它有B标签的标题和单独的ol标签的名单 像这样的 <b> Title of the list </b> <ol> <li> List item 1 </li> <li> list item 2 </li> </ol> 我需要找到这部分 b:hover { /*something that shows the ol list
<b> Title of the list </b>
<ol>
<li> List item 1 </li>
<li> list item 2 </li>
</ol>
我需要找到这部分
b:hover
{
/*something that shows the ol list */
}
使用此代码:
html:
您可以阅读更多信息使用以下代码: html:
您可以阅读更多内容这很有效,我更希望您使用
显示
而不是可见性
<html>
<head>
<title></title>
<style>
b:hover + ol{
display:block;
}
ol{
display:none;
}
</style>
</head>
<body>
<b> Title of the list </b>
<ol>
<li> List item 1 </li>
<li> list item 2 </li>
</ol>
</body>
</html>
b:悬停+ol{
显示:块;
}
ol{
显示:无;
}
名单标题
清单项目1
清单项目2
这很有效,我希望您使用显示
而不是可见性
<html>
<head>
<title></title>
<style>
b:hover + ol{
display:block;
}
ol{
display:none;
}
</style>
</head>
<body>
<b> Title of the list </b>
<ol>
<li> List item 1 </li>
<li> list item 2 </li>
</ol>
</body>
</html>
b:悬停+ol{
显示:块;
}
ol{
显示:无;
}
名单标题
清单项目1
清单项目2
您确定要在显示上使用可见性
吗?的可能重复项您确定要在显示上使用可见性
吗?的可能重复项
ol
{
display:none;
}
b:hover + ol{
display:block;
}
<html>
<head>
<title></title>
<style>
b:hover + ol{
display:block;
}
ol{
display:none;
}
</style>
</head>
<body>
<b> Title of the list </b>
<ol>
<li> List item 1 </li>
<li> list item 2 </li>
</ol>
</body>
</html>