twitter bootstrap -- 导航栏中的中心品牌 [英] twitter bootstrap -- center brand in nav bar

查看:33
本文介绍了twitter bootstrap -- 导航栏中的中心品牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以让我在导航栏中将品牌名称居中

我当前的代码就像

解决方案

居中的几种方法,你可能必须尝试每一种:

设置自动边距:

.brand { margin-left: auto;右边距:自动;}

或者使用绝对定位元素的已知宽度(例如 200 像素):

.brand { 左:50%;左边距:-100px;}

Is there a way I can center the brand name in the nav-bar

My current code is like

<div class="navbar navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
            <ul class="nav pull-left">
                <li>    <button  class="btn btn-primary"> < Back </button> </li>
            </ul>
                <p class="brand"> Report </p> 

                <ul class="nav pull-right">
                    <li>   <button class="btn btn-primary pull-right"> New Report </button>  </li>
                </ul>
        </div>
      </div>
    </div>

解决方案

Couple ways to center, you might have to try each:

Setting auto-margins:

.brand { margin-left: auto; margin-right: auto; }

Or using a known width (200px example) of an absolute positioned element:

.brand { left: 50%; margin-left: -100px; }

这篇关于twitter bootstrap -- 导航栏中的中心品牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
其他开发最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆