简体   繁体   English

如何扩展当前的CSS响应式下拉导航菜单? 下拉菜单无法正常工作

[英]How do I expand my current css responsive drop down navigation menu? Drop down is not working as expected

Currently, I have a drop down menu which works this way: 目前,我有一个下拉菜单可以这样工作:

http://www.feimediasolutions.com/NRA_Website/index_test_menu.html http://www.feimediasolutions.com/NRA_Website/index_test_menu.html

When you begin to resize the browser to a smartphone and/or iPad view, I only want the drop down sub menu to "push" the rest of the menu items down after expanding. 当您开始将浏览器调整为智能手机和/或iPad视图的大小时,我只希望下拉子菜单在扩展后将其余菜单项“推”下。 Currently, the sub drop down items only appear on top of the rest of the menu items. 当前,子下拉菜单项仅出现在其余菜单项的顶部。

How do I expand the drop down menu effectively in this case? 在这种情况下,如何有效地展开下拉菜单? Please help, will appreciate it so much and many thanks in advance!! 请帮忙,非常感谢,谢谢!!

喜的U希望实现的下降是所谓的关于该ü找到关于做吨的信息响应layout..Search ...下面的所有链接将帮助乌拉圭回合的原因.. http://www.1stwebdesigner.com/css / sensitive-website-tutorial / http://webdesignerwall.com/tutorials/sensitive-design-in-3-steps http://www.hongkiat.com/blog/sensitive-web-tutorials/

The main issue here is that the tag holding the drop-down menu is absolutely positioned, removing it from the document flow. 此处的主要问题是放置下拉菜单的标签是绝对放置的,将其从文档流中删除。 This means it won't affect the positions of other elements on the page. 这意味着它不会影响页面上其他元素的位置。 You should use: 您应该使用:

#colorNav li ul {
  position: relative;
}

...on the full-width responsive version if you want the drop down to 'push' other content on the page. ...在全角响应版本上,如果您希望下拉菜单以“推送”页面上的其他内容。 It'll need various other CSS fixups to make it look nice. 它需要各种其他CSS修补程序才能使其看起来不错。

However, you'll have more issues, as there is no 'hover' on a touch device, so you'll need to trigger the drop down another way. 但是,您会遇到更多问题,因为触摸设备上没有“悬停”,因此您需要以其他方式触发下拉菜单。

@media screen and (max-width: 768px) {
  #colorNav li ul{
    position: relative;
    list-style:none;
    text-align:center;
    /*width:180px;*/
    width: 100%;
    left: -40px;
    top: 45px;
    /*left:50%;
    margin-left:-90px;
    top:70px;*/
    font-family: 'Lato', sans-serif;
    max-height:0px;
    overflow:hidden;

    -webkit-transition:max-height 0.4s linear;
    -moz-transition:max-height 0.4s linear;
    transition:max-height 0.4s linear;
  }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM