Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
CSS-将鼠标悬停在元素E2上时显示元素E1_Css_Html_Hover - Fatal编程技术网

CSS-将鼠标悬停在元素E2上时显示元素E1

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

这是一个奇怪的问题,但我得到了一个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 */
 } 
使用此代码:

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>