HTML下拉菜单删除LI元素之间的空白 [英] HTML Dropdown Menu remove white space between LI element

查看:131
本文介绍了HTML下拉菜单删除LI元素之间的空白的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将图像用作下拉列表项,发现每个元素之间没有多余的空格,因此想知道是否有可能删除所有空格

I'm using image as dropdownlist items and found that there are unnecessary white space in between each of the element and hence wondering if it's possible to remove all of the white spaces

<html>
<head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <link rel="stylesheet" type="text/css" href="demo.css">
</head>
<body>
    <div id='wrap'>
        <div id="clickable_div">MENU</div>
            <div id="nav_menu">
                <ul class="dropDown">
                    <li><img src="ori_12.png"></li>
                    <li><img src="ori_12.png"></li>
                    <li><img src="ori_12.png"></li>
                    <li><img src="ori_12.png"></li>
                </ul>
            </div>
        </div>
    </div>

</body>
<script>
        $('#wrap').mouseover( function(){
            $('#nav_menu').slideDown();
        })
        $('#wrap').mouseleave( function(){
            $('#nav_menu').slideUp();
        });

    </script>
</html> 

下面是我的 Demo.css :

#clickable_div {width:166px; background-color:#9c9c9c;}
*{margin:0; padding:0}
#nav_menu{width:166px; height:auto; background-color:#CCC;display:none;}

#wrap{ width:166px }

推荐答案

 <style>
    li{
        display: block;
        border: 0px;
    }
</style>

添加此样式,希望它能起作用

add this style hope it will work

这篇关于HTML下拉菜单删除LI元素之间的空白的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆