css + html菜单命中箱

时间:2015-07-03 12:40:14

标签: javascript html css

我使用不同的互联网资源编写了一些代码。我遇到了一个问题 - 菜单底部的每个对象都无法与之交互。 菜单会干扰下拉列表下方的所有内容。

<style>
body {
    padding: 0;
    margin: 0;
    font-family: Arial;
    font-size: 23px;
}
#nav {
    background-color:1a1a1a;
    opacity: 0.9;
}
#nav_wrapper {
    width: 960px;
    margin: 0 auto;
    text-align: right;
}
#nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    position: relative;
    min-width: 200px;
}
#nav ul li {
    display: inline-block;
}
#nav ul li:hover {
    background-color: #333;
}
#nav ul li a, visited {
    color: #CCC;
    display: block;
    padding: 15px;
    text-decoration: none;
}
#nav ul li:hover ul {
    display: block;
}
#nav ul ul {
    display: none;
    position: absolute;
    background-color: #333;
    border: 0px solid #222;
    border-top: 0;
    margin-left: -5px;
}
#nav ul ul li {
    display: block;
}
#nav ul ul li a:hover {
    color: #699;
}
.left-to-right {
    text-align: left;
}
</style>
<html lang="he">
<body  dir-"rtl"><div id="nav">

    <div id="nav_wrapper">
<div>
        <ul <ul  dir="RTL">

            <li> <a href="#">תרמילים</a>

                <ul class="left-to-right">
<!--  <li class="backpacks" id="firstlight-20l"> <a href="/products/firstlight-20l"> FirstLight 20L</a> </li>

                        <li class="backpacks" id="firstlight-30l"> <a href="/products/firstlight-30l"> FirstLight 30L</a> </li>

                        <li class="backpacks" id="firstlight-40l"> <a href="/products/firstlight-40l"> FirstLight 40L</a> </li>-->

                        <li class="backpacks"> <a href="/products/rotation180-professional-Deluxe"> rotation180° Professional 38L Deluxe</a> </li>

                        <li class="backpacks"> <a href="/products/rotation180-horizon"> rotation180° Horizon 34L</a> </li>

                        <li class="backpacks"> <a href="/products/rotation180-panorama"> rotation180° Panorama 22L</a> </li>

<!--                        <li class="backpacks" id="rotation180-travel-away"> <a href="/products/rotation180-travel-away"> rotation180° Travel Away 22L</a> </li>-->

                        <li class="backpacks" id="rotation180-trail"> <a href="/products/rotation180-trail"> rotation180° Trail 16L</a> </li>

                      </ul>
            </li>
            <li> <a href="#">תיקי מצלמות ספורט</a>

                <ul class="left-to-right">
                    <li><a href="#">GP 1 kit case</a>
                    </li>
                    <li><a href="#">GP 2 kit case</a>
                    </li>
                </ul>
            </li>
            <li> <a href="#">אביזרים</a>

                <ul class="left-to-right">
                    <li><a href="#">r180º Panorama/Horizon Photo Insert</a>
                    </li>

                </ul>
            </li>

        </ul>
</div>
    </div>
</div>
</body>
</html>

3 个答案:

答案 0 :(得分:0)

您可以使用vertical-align作为列表元素&amp;文本对齐链接。

答案 1 :(得分:0)

#nav_wrapper ul ul li{ text-align:left;}

您只需要添加此内容:demo

答案 2 :(得分:0)

只需在每个下拉列表的<ul>标记中添加一个类,然后向其中添加text-align: left

<强> FIDDLE Here