如何让导航菜单栏水平滚动

时间:2017-05-06 11:39:06

标签: html css responsive-design navbar

我有一个带有几个li标签的导航栏,当屏幕尺寸较小时,它们会互相落在一起。我希望导航栏保持相同的高度并在较小的设备屏幕上水平滚动,但我尝试的所有内容都无法正常工作。有人可以点亮这里有什么问题!

HMTL:

<nav role="navigation" class="site-navigation main-navigation">
  <div class="menu">
    <ul>
      <li class="page_item page-item-40"><a href="http://localhost/property_abba/for-sale/">Buy</a></li>
      <li class="page_item page-item-41"><a href="http://localhost/property_abba/for-rent/">Rent</a></li>
      <li class="page_item page-item-7"><a href="http://localhost/property_abba/sell/">Sell</a></li>
      <li class="page_item page-item-9 current_page_item"><a href="http://localhost/property_abba/valuations/">Valuations</a></li>
      <li class="page_item page-item-15"><a href="http://localhost/property_abba/property-management/">Property Management</a></li>
      <li class="page_item page-item-11"><a href="http://localhost/property_abba/about-us/">About Us</a></li>
      <li class="page_item page-item-13"><a href="http://localhost/property_abba/contact-us/">Contact Us</a></li>
    </ul>
  </div>
</nav>

CSS:

@media screen and (max-width : 480px){
  div.menu ul {
    display: inline-block;
    max-height: 34px;
    overflow: auto;
    white-space: nowrap;
  }
  div.menu a {
    display: inline-block;
    text-align: center;
  }
}

但这目前无效。

1 个答案:

答案 0 :(得分:0)

水平滚动菜单移动

=SUM(($A$1:$A$5=$C$1:$C$5)*(MONTH($A$1:$A$5)=1)*(YEAR($A$1:$A$5)=2010)*$B$1:$B$5)