0

我有一个 Bootstrap 3 nav-pills 菜单,它会在移动设备上折叠,但是当您单击导航栏切换菜单时,菜单会打开,然后立即跳上大约 40-50 像素?

它根本无法在 iPhone 上打开。:(

它在这里: http ://www.portpatrick.me.uk/rickwood/hotel-rooms-portpatrick.php

仔细检查了 CSS,我看不到,也许是为了树木,为什么要这样做。希望有人可以帮助指出显而易见的。

谢谢你。新泽西州

菜单..

<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#rickwoodcollapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>

<div class="collapse navbar-collapse" id="rickwoodcollapse">
<ul class="nav nav-pills nav-justified">
<li role="presentation"><a href="index.php" id="home">Home</a></li>
<li role="presentation"><a href="hotel-rooms-portpatrick.php" id="rooms">Rooms</a></li>
<li role="presentation"><a href="dinner-breakfast-dining.php" id="dining">Dining</a></li>
<li role="presentation" class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-expanded="false" id="attractions">Attractions <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="beaches-coast-portpatrick.php">Beaches &amp; Coast</a></li>
<li><a href="public-gardens-scotland.php">Gardens</a></li>
<li><a href="mull-of-galloway.php">Mull of Galloway</a></li>
</ul>
</li>
<li role="presentation" class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-expanded="false" id="activities">Activities <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="walking-portpatrick-scotland.php">Walking</a>
<li><a href="walking-in-portpatrick.php">Walking in Portpatrick</a></li>
<li><a href="walking-dumfries-galloway.php">Further Afield</a></li>
<li><a href="Mull-of-Galloway-Trail.php">Mull of Galloway Trail</a></li>
<li><a href="golf-courses-wigtownshire.php">Golf Courses</a></li>
<li><a href="cycling-portpatrick-scotland.php">Cycling</a></li>
</ul>                    
</li>
<li role="presentation"><a href="portpatrick-scotland.php">Location</a></li>
<li role="presentation"><a href="news-events-portpatrick.php">News</a></li>
<li role="presentation"><a href="contact.php">Contact</a></li>
</ul>
</div>

CSS ... http://www.portpatrick.me.uk/rickwood/styles.css

我将努力学习如何做一个 jsfiddle 或 github 或任何它被称为的东西。谢谢你。新泽西州

4

1 回答 1

0

在您的styles.css文件(当前为第 158 行)上,这一行包含一个line-height.

.nav .open > a, .nav .open > a:focus, .nav .open > a:hover {
  height: 60px;
  background-color: #14214D;
}

删除height: 60px;,菜单不再跳转。我在 iPhone 模拟器上进行了测试,效果很好。我没有 iPhone(喘气!),所以我无法在实际设备上进行测试。

于 2015-04-21T23:10:41.443 回答