Text in Twitter Bootstrap navbar

无人久伴 提交于 2019-12-04 21:08:31

Is this what you had in mind?

http://jsbin.com/uvonej/2

http://jsbin.com/uvonej/2/edit

This .jsbin example builds off of the .brand class you can find when you inspect the the bootstrap documentation for the .navbar component.

css

    <style type="text/css">
    /* see the .brand styling in bootstrap .css */
    .login-blurb {
      display: block;
      float: left;
      padding: 10px 20px 10px;
      margin-left: -20px;   
      color: #e7e7e7;
    }
  </style>

html

 <div class="navbar navbar-inverse navbar-fixed-top">
  <div class="navbar-inner">
    <div class="container">
      <span class="login-blurb">You are logged in as: <strong>username<strong></span>
      <ul class="nav pull-right">
        <li><a href="#action=logout">Logout</a></li>
      </ul>
    </div>
  </div>
</div>

Use .pull-left or .pull-right. Elements on a navbar must be floating and these are the corresponding native classes.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!