使用 bootstrap 使徽标出现在 "hang off" 导航中
Make logo appear to "hang off" nav with bootstrap
我想要实现的是这样的:
https://dl.dropboxusercontent.com/u/109053092/Screen%20Shot%202015-01-21%20at%2014.49.45.png
我正在使用 Bootstrap 3,我正在使用下面的代码创建我的导航:
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="index.php" title="Barcelona 226 Center Exclusive - Official site"><img src="../assets/images/logo.png" alt="Barcelona226"></a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="index.php">Home</a></li>
<li class="dropdown">
<a href="apartments" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Exclusive Apartments <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="../apartments">View All</a></li>
<li class="dropdown-header">4 Bedroom</li>
<li><a href="#">Superior</a></li>
<li><a href="#">Standard</a></li>
<li class="divider"></li>
<li class="dropdown-header">3 Bedroom</li>
<li><a href="#">Superior</a></li>
<li><a href="#">Superior Tuset</a></li>
</ul>
</li>
<li class="active"><a href="../rooms">Exclusive Rooms</a></li>
<li><a href="#contact">Contact and Location</a></li>
</ul>
</div>
</div>
</nav>
我想不通,有指点吗?
只需将此 CSS 用作您的徽标元素即可:
position : absolute;
top : 10px;
绝对位置会将元素移出其容器。
我想要实现的是这样的:
https://dl.dropboxusercontent.com/u/109053092/Screen%20Shot%202015-01-21%20at%2014.49.45.png
我正在使用 Bootstrap 3,我正在使用下面的代码创建我的导航:
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="index.php" title="Barcelona 226 Center Exclusive - Official site"><img src="../assets/images/logo.png" alt="Barcelona226"></a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="index.php">Home</a></li>
<li class="dropdown">
<a href="apartments" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Exclusive Apartments <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="../apartments">View All</a></li>
<li class="dropdown-header">4 Bedroom</li>
<li><a href="#">Superior</a></li>
<li><a href="#">Standard</a></li>
<li class="divider"></li>
<li class="dropdown-header">3 Bedroom</li>
<li><a href="#">Superior</a></li>
<li><a href="#">Superior Tuset</a></li>
</ul>
</li>
<li class="active"><a href="../rooms">Exclusive Rooms</a></li>
<li><a href="#contact">Contact and Location</a></li>
</ul>
</div>
</div>
</nav>
我想不通,有指点吗?
只需将此 CSS 用作您的徽标元素即可:
position : absolute;
top : 10px;
绝对位置会将元素移出其容器。