Bootstrap导航栏上的音频播放器

时间:2016-07-16 19:39:57

标签: twitter-bootstrap-3 navbar

我正在尝试将元素置于引导导航栏上。一切都有效,直到我添加音频播放器。

任何人都可以帮我解决如何集中我的导航栏元素,以及如何确保它在移动设备上工作?

这是我的代码:

 <nav class="navbar navbar-inverse">
<div class="container-fluid top-nav">
    <ul class="nav navbar-nav">
        <li class="nav-item">
            <a class="nav-link" href="https://www.facebook.com/999fmthezoo?ref=hl" target="_blank" onclick="ga('send', 'event', 'link', 'click', 'Facebook Social Clicks');">
                <i class="fa fa-circle fa-stack-2x"></i>
                <i class="fa fa-facebook fa-stack-1x fa-inverse"></i>
            </a>
        </li>

        <li class="nav-item">
            <a class="nav-link" href="https://twitter.com/wzooradio" target="_blank" onclick="ga('send', 'event', 'link', 'click', 'Twitter Social Clicks');">
                <i class="fa fa-circle fa-stack-2x"></i>
                <i class="fa fa-twitter fa-stack-1x fa-inverse"></i>
            </a>
        </li>

        <li class="nav-item">
            <ul class="nav navbar-nav">
                <li class="nav-item">
                    <audio preload="auto" controls>
                        <source src="http://stream1.mtcstream.com:8500/wzoo">
                    </audio>
                </li>
            </ul>
        </li>

        <li class="nav-item">
            <ul class="nav navbar-nav navbar-right cta-container">
                <li class="nav-item">
                    <a class="phone" href="tel:336-672-3333">Call <u>336-672-3333</u></a>
                </li>
            </ul>
        </li>
    </ul>
</div>

1 个答案:

答案 0 :(得分:1)

使用网格系统作为中心我不确定你,但它对我有用

Link to example in jsbin

<强> HTML

<html>
  <head>
    <title>Landing Page</title>
    <link rel="stylesheet" type="text/css" href="MylandingSS.css"/>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity=      "sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
    <link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet"/>
  </head>
  <body>
    <div class="navbar navbar-default navbar-fixed-top">
      <!----------------HEADER------------------------------>
        <div class="navbar-header navbar-brand header"><h1 class="navbarheader">IamAbcdef</h1></div>
     <!------------------LINKS----------------------------------->
    <div class="row">
      <div class="col-md-6 col-md-offset-3">
        <ul class="nav navbar-nav">
        <li><a href="">Page 1</a></li>
        <li><a href="">Page 2</a></li>
        <li><a href="">Page 3</a></li>
        </ul>
      </div>  
  </div>

  </div>

  </body>
</html>

<强> CSS

@charset "utf-8";
/* CSS Document */
body{
    margin:0;
    padding:0;
        }
.navbar.navbar-default{
    background-image:none;
    background-color:rgba(89,63,127,0.79);
    border:none;
}
.navbarheader{
    color:#FFFFFF;
    margin-top:-10px;
    font-family: 'Lobster', cursive;
}
.nav,.navbar-nav{
    font-size:15px;
    color:white;

}