将徽标图像居中并将响应式导航栏放在徽标下方

时间:2016-08-28 14:07:44

标签: html css twitter-bootstrap

<nav id="navbar-custom" class="navbar navbar-inverse 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>
    </div>
    <a class="navbar-brand" href="GIỚI THIỆU.HTML"><img src="logo.png" alt="logo-Image"></a>
    <div id="navbar" class="collapse navbar-collapse">
      <ul class="nav navbar-nav mynavbar">
        <li><a id="menu_link" href="GIỚI THIỆU.html">GIỚI THIỆU</a></li>
        <li><a id="menu_link" href="#EVAALUTION">ĐÁNH GIÁ</a></li>
        <li><a id="menu_link" href="ĐĂNG KÝ.HTML">ĐĂNG KÝ</a></li>
      </ul>
    </div><!--/.nav-collapse -->

我坚持在页面的中上部创建一个带有徽标的响应式发音教学网站,并将菜单放在徽标下方。我怎么能用bootstrap做到这一点? all i want is make my web as the photo

4 个答案:

答案 0 :(得分:1)

在跳入Twitter Bootstrap之前,你最好学习CSS。

另外,请发布代码的jsfiddle或jsbin。

您可以简单地将其集中在:

.logo {
  margin: 0 auto;
}

否则,您可以使用Bootstrap网格系统伪标记徽标。

答案 1 :(得分:0)

只需一个徽标类,然后将以下css添加到该类

  .logo{margin: 0 auto;}

要了解CSS登录site

答案 2 :(得分:0)

将您的徽标包裹在col-xs-12中,这样它就会占据导航栏容器的整个宽度 - 您可以稍后将其向左/向右/向中拉:

<div class='col-xs-12'><a class="navbar-brand" href="GIỚI THIỆU.HTML"><img src="logo.png" alt="logo-Image"></a></div>

我不确定这是否是你想要实现的目标,但你去了。

答案 3 :(得分:0)

我使用了带有徽标

的小课程
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>

</style>
</head>
<body>

<nav id="navbar-custom" class="navbar navbar-inverse 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>
</div>
<div class="col-xs-12">   <a class="navbar-brand " href="GIỚI THIỆU.HTML"><img src="logo.png" alt="logo-Image"></a></div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav mynavbar">
<li><a id="menu_link" href="GIỚI THIỆU.html">GIỚI THIỆU</a></li>
<li><a id="menu_link" href="#EVAALUTION">ĐÁNH GIÁ</a></li>
<li><a id="menu_link" href="ĐĂNG KÝ.HTML">ĐĂNG KÝ</a></li>
</ul>
</div><!--/.nav-collapse -->
</body>
</html>