Php 如何处理我的css下拉菜单上的间隙?

Php 如何处理我的css下拉菜单上的间隙?,php,html,css,Php,Html,Css,我迫切需要帮助我的css编码。我是新手 #accountTitle padding: 0; display: block; margin-top: 90px; margin-bottom: -120px; margin-left: 50px; font-size: 36px; a:active background-color: #a6d8a8; table margin-left: auto; margin-right: auto; width: 100%; margin-to

我迫切需要帮助我的css编码。我是新手

#accountTitle
padding: 0;
display: block;
margin-top: 90px;
margin-bottom: -120px;
margin-left: 50px;
font-size: 36px;


a:active 
background-color: #a6d8a8;




table 
margin-left: auto;
margin-right: auto;
width: 100%;
margin-top: 50px;
overflow-x:auto;


 td 
  text-align:left;

   th, td

padding: 15px;



th 
    background-color: #4CAF50;
    color: white;
    text-align: center;



tr:hover 
background-color: #a6d8a8;
cursor: pointer;




#container 
margin-top: 135px;
position: relative;
padding: 0;
overflow: hidden;
background-color: #333;
border-radius: 10px;
width: 100%;




.wrap
margin-right: 10px;
text-align: center;



.dropbtn

background-color: #333;
color: white;
padding: 16px;
font-size: 16px;
border: none;
cursor: pointer;



.dropdown 
position: relative;
display: inline-block;
margin-right: 5px;



   .dropdown-content 

    display: none;
    position: fixed;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 2;


     .dropdown-content a 
      color: black;
      padding: 12px 16px;
      text-decoration: none;
      display: block;
      text-align: left;


        .dropdown-content a:hover 
         background-color: #f1f1f1

         .dropdown:hover .dropdown-content
          display: block;



          .dropdown:hover .dropbtn 
           background-color: #434343;



<label id="accountTitle">Audit Log</label>
<div id="container">
<div class="wrap">
<div class="dropdown">
<button class="dropbtn" id="homebtn">Home</button>
<div class="dropdown-content">
<a href="#">Main Page</a>
<a href="#">Accounts</a>
<a href="#">Audit Log</a>
<a href="#">Logout</a>
</div>
</div>
#会计标题
填充:0;
显示:块;
边缘顶部:90像素;
边缘底部:-120px;
左边距:50像素;
字体大小:36px;
a:主动的
背景色:#a6d8a8;
桌子
左边距:自动;
右边距:自动;
宽度:100%;
边缘顶部:50px;
溢出-x:自动;
运输署
文本对齐:左对齐;
th,td
填充:15px;
th
背景色:#4CAF50;
颜色:白色;
文本对齐:居中;
tr:悬停
背景色:#a6d8a8;
光标:指针;
#容器
边缘顶部:135px;
位置:相对位置;
填充:0;
溢出:隐藏;
背景色:#333;
边界半径:10px;
宽度:100%;
包
右边距:10px;
文本对齐:居中;
.dropbtn
背景色:#333;
颜色:白色;
填充:16px;
字体大小:16px;
边界:无;
光标:指针;
.下拉列表
位置:相对位置;
显示:内联块;
右边距:5px;
.下拉内容
显示:无;
位置:固定;
背景色:#f9f9f9;
最小宽度:160px;
盒影:0px 8px 16px 0px rgba(0,0,0,0.2);
z指数:2;
.下拉内容a
颜色:黑色;
填充:12px 16px;
文字装饰:无;
显示:块;
文本对齐:左对齐;
.下拉列表内容a:悬停
背景色:#f1f1
.下拉:悬停.下拉内容
显示:块;
.dropdown:悬停.dropbtn
背景色:#434343;
审核日志
家

这里的问题是,每当我向下滚动时,这种情况就会发生


拜托,我真的需要完成这件事

减少
的填充。下拉列表内容a
应该是这样的

   .dropdown-content a 
{
      color: black;
      padding: 0px 16px;
      text-decoration: none;
      display: block;
      text-align: left;
}

我不太理解这个问题,但是如果问题是下拉列表根本没有出现,那么您必须更改您的
。下拉列表:悬停。下拉列表内容类似这样

.dropdown:hover .dropdown-content{
      display: block;
      z-index: 1;
 }

z-index根据其拥有的数字更改html呈现优先级,数字越大,优先级越高。

溢出
#容器中取出,并将
位置更改为
。下拉内容
绝对

#container {
    ...
    padding: 0;
    /* overflow: hidden; DELETE THIS */
    background-color: #333;
    ...
}

.dropdown-content {
    display: none;
    position:  absolute;
    ...
}

你能和大家分享一下html,更好地理解@Markyth你发布的代码A)甚至不是合法的CSS,B)不是完整的代码,它没有向我们提供你在图片中发布的内容。从你发布的代码来看,一切看起来都很好。我有一个充满数据的表格,比如说50行数据,我需要向下滚动页面,但每当我将鼠标悬停在我的菜单上时,下拉内容和主页文本链接之间就会有一个间隙。对不起,我的语法,我的英语真的不太好。现在我明白了,那就照阿马拉德说的去做吧!!!!非常感谢。我已经自杀快一天了。