菜单之间的CSS空白区域

时间:2013-01-09 04:28:45

标签: css

我在菜单栏的单词之间有CSS空格问题。我尝试了很多方法,但仍然无法解决它。有人可以帮助我吗?

菜单问题的图片如下所示: http://imageshack.us/photo/my-images/201/44262065.jpg/

我希望结果是这样的,每个菜单之间的空间较小: http://i47.tinypic.com/2vvwcnn.jpg

这是我的css:

  #cssmenu{
     border:none;
     border:0px;
     margin:0px;
     padding:0px;
     font-family:verdana,geneva,arial,helvetica,sans-serif;
     font-size:14px;
     font-weight:bold;
     color:8e8e8e;
}
  #cssmenu ul{
     background:url(img/menu-bg.gif) top left repeat-x;

     height:43px;
     list-style:none;
     margin:0;
     padding:0;


}
#cssmenu li{
    float:left;
    padding:0px 0px 0px 132px;
    display: inline-block;
    }
#cssmenu li a{
    color:#666666;
    display:block;
    font-weight:bold;
    line-height:43px;
    padding:0px 0px;
    text-align:left;
    text-decoration:none;
    }
    #cssmenu li a:hover{
        color:#000000;
        text-decoration:none;
        }
#cssmenu li ul{
    background:#e0e0e0;
    border-left:2px solid #f68618;
    border-right:2px solid #f68618;
    border-bottom:2px solid #f68618;
    display:none;
    height:auto;
    filter:alpha(opacity=95);
    opacity:0.95;
    position:absolute;
    width:180px;
    z-index:200;
    /*top:1em;
    /*left:0;*/
    }
#cssmenu li:hover ul{
    display:block;
    }
#cssmenu li li {
    display:block;
    float:none;
    padding:0px;
    width:180px;
    }
#cssmenu li ul a{
    display:block;
    font-size:12px;
    font-style:normal;
    padding:0px 10px 0px 15px;
    text-align:left;
    }
    #cssmenu li ul a:hover{
        background:#949494;
        color:#000000;
        opacity:1.0;
        filter:alpha(opacity=100);
        }
#cssmenu p{
    clear:left;
    }   
#cssmenu .active > a:hover {
    color:#ffffff;
    }

这是我的HTML代码:

<div id='cssmenu'>

<ul>
   <li><a href='index.php'><span>Home</span></a></li>
   <li><a href='promotions.php'><span>Promotions</span></a></li>
   <li><a href='outlets.php'><span>Outlets</span></a></li>
   <li><a href='feedback.php'><span>Feedback</span></a></li>
   <li class='has-sub '><a href='#'><span>Career</span></a>
      <ul>
         <li><a href='stall.php'><span>Stall Leasing</span></a></li>
         <li><a href='career.php'><span>Career Opportunity</span></a></li>
      </ul>
   </li>
   <li><a href='contactUs.php'><span>Contact Us</span></a></li>
</ul>

                </div>

2 个答案:

答案 0 :(得分:0)

尝试从.border类中移除填充,在蓝色round.css文件中的第311行

答案 1 :(得分:0)

使用这个减少你的li和行高的填充

#cssmenu li{
    float:left;
    padding:30px;
    display: inline-block;
    }