Bootstrap更改导航栏字体大小

时间:2015-10-29 00:49:16

标签: css twitter-bootstrap css3 twitter-bootstrap-3 navbar

我浪费了2个小时,寻找解决方案。我想更改导航栏的字体大小,甚至在媒体查询中更改字体大小。我可以更改颜色而不是字体,有时字体会更改col-lg但不会更改media-queries

HTML

<nav class="navbar navbar-default">
            <div class="container-fluid">

            <div class="navbar-header">
              <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
            </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
          <ul class="nav navbar-nav">

            <li class="active"><a href="#">Home<span class="sr-only">(current)</span></a></li>
            <li> <a class="nav-links" href="aboutus.html"><span style="white-space: nowrap">About Us</span></a> </li>
            <li> <a class="nav-links" href="whoweare.html"><span style="white-space: nowrap">Who We Are</span></a> </li>
            <li> <a class="nav-links" href="mission.html">Mission</a> </li>
            <li> <a class="nav-links" href="activities.html">Activities</a> </li>
            <li> <a class="nav-links" href="gallery.html">Gallery</a> </li>
            <li> <a class="nav-links" href="donate.html">Donate</a> </li>
            <li> <a class="nav-links" href="sitemap.html">Sitemap</a> </li>
            <li> <a class="nav-links" href="contactus.html"><span style="white-space: nowrap">Contact Us</span></a> </li>

          </ul>


        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
    </nav>

CSS

 nav {
                width: 100%;
                height: 40px;
                background: -webkit-linear-gradient(#3f9a15, #388813, #3f9a15, #388813, #3f9a15);
                background: -o-linear-gradient(#3f9a15, #388813, #3f9a15, #388813, #3f9a15);
                background: linear-gradient(#3f9a15, #388813, #3f9a15, #388813, #3f9a15);
                border-radius: 6px !important;
                -moz-border-radius: 6px !important;
            }

        .nav a{
            color: white !important;
            font-size: 1.8em !important;
        }

1 个答案:

答案 0 :(得分:2)

考虑到您希望链接<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <table id="dataTable"> <tr id="data1"> <td class="number">1,2</td> <td class="name">Tod</td> </tr> <tr id="data2"> <td class="number">8,10</td> <td class="name">Smith</td> </tr> </table> <button type="button" class="button">Order</button>padding-right之间的Home等,这是一个有效的demo

对于我使用Aboutcss

的链接
.nav li