修复响应式移动菜单

时间:2015-09-25 00:36:42

标签: html css drop-down-menu responsive-design

我有一个菜单,我正在这个链接上发展:

http://events.discoverportland.net/

菜单应加载到发现波特兰徽标右侧的蓝色方块。菜单中有几个嵌套的ul,我遇到的问题就是将它们加载到菜单上方,因为它现在加载,你无法进入teritairy链接除非你非常快速地移动。

当我将鼠标悬停在它们上面时,有没有办法让uls加载内联,还是有更好的解决方案?

这是我的导航HTML:

<nav>
<a href="#" id="menu-icon"></a>
                <div class="clearfix hd8  suckerfish" >
                    <ul id="md">
<li><a href="http://www.discoverportland.net/index.php">Home2</a></li>
<li><a href="http://www.discoverportland.net/index.php/neighborhoods">Neighborhoods</a>
    <ul>
        <li><a href="http://www.discoverportland.net/index.php/neighborhoods/northwest">Northwest</a>
            <ul>
                <li><a href="http://www.discoverportland.net/index.php/neighborhoods/northwest/pearl-district">Pearl District</a></li>
                <li><a href="http://www.discoverportland.net/index.php/neighborhoods/northwest/oldtown-chinatown">Oldtown-Chinatown </a></li>
                <li><a href="http://www.discoverportland.net/index.php/neighborhoods/northwest/nob-hill">Nob Hill</a></li>
            </ul>
        </li>
        <li><a href="http://www.discoverportland.net/index.php/neighborhoods/southwest">Southwest</a>
            <ul>
                <li><a href="http://www.discoverportland.net/index.php/neighborhoods/southwest/west-end">West End</a></li>
                <li><a href="http://www.discoverportland.net/index.php/neighborhoods/southwest/riverplace-south-waterfront">Riverplace-South Waterfront</a></li>
                <li><a href="http://www.discoverportland.net/index.php/neighborhoods/southwest/downtown">Downtown</a></li>
            </ul>
        </li>
        <li><a href="http://www.discoverportland.net/index.php/neighborhoods/southeast">Southeast</a>
            <ul>
                <li><a href="http://www.discoverportland.net/index.php/neighborhoods/southeast/sellwood-westmoreland">Sellwood-Westmoreland</a></li>
                <li><a href="http://www.discoverportland.net/index.php/neighborhoods/southeast/hawthorne">Hawthorne</a></li>
                <li><a href="http://www.discoverportland.net/index.php/neighborhoods/southeast/clinton-division">Clinton-Division</a></li>
            </ul>
        </li>
        <li><a href="http://www.discoverportland.net/index.php/neighborhoods/northeast">Northeast</a>
            <ul>
                <li><a href="http://www.discoverportland.net/index.php/neighborhoods/northeast/alberta">Alberta</a></li>
                <li><a href="http://www.discoverportland.net/index.php/neighborhoods/northeast/lloyd-district">Lloyd District</a></li>
                <li><a href="http://www.discoverportland.net/index.php/neighborhoods/northeast/hollywood">Hollywood District</a></li>
            </ul>
        </li>
        <li><a href="http://www.discoverportland.net/index.php/neighborhoods/north">North</a>
            <ul>
                <li><a href="http://www.discoverportland.net/index.php/neighborhoods/north/mississippi">Mississippi</a></li>
                <li><a href="http://www.discoverportland.net/index.php/neighborhoods/north/williams">Williams</a></li>
                <li><a href="http://www.discoverportland.net/index.php/neighborhoods/north/st-johns-university-of-portland">St. Johns</a></li>
            </ul>
        </li>
    </ul>
</li>
<li><a href="http://www.discoverportland.net/index.php/itineraries">Itineraries</a></li>
<li><a href="http://www.discoverportland.net/index.php/day-trips">Day Trips</a></li>
<li><a href="http://www.discoverportland.net/index.php/food-and-drink">Food+Drink</a>
    <ul>
        <li><a href="http://www.discoverportland.net/index.php/food-and-drink/dining-picks">Dining Picks</a></li>
        <li><a href="http://www.discoverportland.net/index.php/food-and-drink/food-cart-fare">Food Cart Fare </a></li>
        <li><a href="http://www.discoverportland.net/index.php/food-and-drink/beer-wine-spirits">Beer, Wine &amp; Spirits</a></li>
        <li><a href="http://www.discoverportland.net/index.php/food-and-drink/cafe-culture">Café Culture</a></li>
    </ul>
</li>
<li><a href="http://www.discoverportland.net/index.php/to-do">To Do</a>
    <ul>
        <li><a href="http://www.discoverportland.net/index.php/to-do/shopping">Shopping</a></li>
        <li><a href="http://www.discoverportland.net/index.php/to-do/recreation">Recreation</a></li>
        <li><a href="http://www.discoverportland.net/index.php/to-do/culture">Culture</a>
            <ul>
                <li><a href="http://www.discoverportland.net/index.php/to-do/culture/moset-02-galleries">Galleries</a></li>
            </ul>
        </li>
        <li><a href="http://www.discoverportland.net/index.php/to-do/family">Family</a></li>
    </ul>
</li>
<li><a href="http://events.discoverportland.net">Events</a></li>
</ul>
</nav>

这是我正在使用的css:

nav ul ul li a::before {
  content: "\f0da";
  font-family: FontAwesome;
  margin-right: 8px;
}

nav { 
text-transform:uppercase;
font-family: Oswald,Arial,Helvetica,sans-serif !important;
    font-size: 14px;
    font-weight: 100 !important;
    letter-spacing: 1px!important;
}
nav ul ul {
    display: none;
}

    nav ul li:hover > ul {
        display: block;
    }
nav ul {
    background: #FF0066; 
    padding: 2px 0 0 64px;
    border-radius: 0px;  
    list-style: none;
    position: relative;
    display: inline-table;
}
    nav ul:after {
        content: ""; clear: both; display: block;
    }
nav ul li {
    float: left;

}
    nav ul li:hover {
        background: #FF0066;
    }
        nav ul li:hover a {
            color: #fff;

        }

    nav ul li a {
        display: block; padding: 15px 20px;
        color: #fff; text-decoration: none;
    }
nav ul ul {
    background: #FF0066; border-radius: 0px; padding: 0;
    position: absolute; top: 100%;
}
    nav ul ul li {
        float: none; 
        position: relative;
    }
        nav ul ul li a {
            padding: 15px 25px;
            color: #fff;
                               font-family: 'Fira Sans', sans-serif;Important;
                               font-size: 12px;
        }   
            nav ul ul li a:hover {
                background: #AD0548;
            }
nav ul ul ul {
    position: absolute; left: 100%; top:0;
}
nav ul ul ul li {
  width: 275px !important;
}
@media (max-width: 767px) {
#logo a {
  background: rgba(0, 0, 0, 0) url("http://discoverportland.net/templates/urbanlife/images/logos/DP_HeadingLogo2.png") no-repeat scroll 0 0 / 100% auto;
  height: 60px;
  margin: 0 !important;
  width: 60px !important;
}
       #menu-icon {
    display:inline-block;
    }
    nav ul, nav:active ul { 
display: none;
        position: absolute;
        right: 20px;
        top: 60px;
        width: 50%;
        border-radius: 4px 0 4px 4px;
    }
    nav li {
        text-align: center;
        width: 100%;
        padding: 10px 0;
        margin: 0;
    }
    nav:hover #md {
        display: inline-block;
    }
}

0 个答案:

没有答案