html - 菜单不适用于移动设备

标签 html css twitter-bootstrap mobile drop-down-menu

我的网站终于达到了我想要的样子 - 但是没有移动菜单?我什至重新安装了模板,当我通过手机查看时,没有菜单。是否可以解决此问题,或者我是否需要搜索新模板?

站点是http://welshmediation.com/ .

    <!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="santa barbara mediator">
    <meta name="Jennie Walsh Mediation" content="">

    <title>Jennie K. Welsh Mediation</title>

    <!-- Bootstrap Core CSS -->
    <link href="/css/bootstrap.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="/css/small-business.css" rel="stylesheet">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="/js/html5shiv.js"></script>
        <script src="/js/respond.min.js"></script>
    <![endif]-->

    <style type="text/css">
    .auto-style1 {
        font-size: large;
    }
    .auto-style3 {
        text-align: center;
        font-size: large;
    }
    .auto-style5 {
        font-size: medium;
    }
    .auto-style13 {
        font-size: large;
        color: #F17411;
    }
    .auto-style17 {
        width: 1170px;
        text-align: center;
        margin-left: auto;
        margin-right: auto;
        padding-left: 15px;
        padding-right: 15px;
    }
    .auto-style18 {
        float: left;
        text-align: center;
    }
    .auto-style19 {
    font-family: "Lucida Sans", "Lucida Sans Regular", "Lucida Grande", "Lucida Sans Unicode", Geneva, Verdana, sans-serif;
    font-size: medium;
    text-align: center;
}
    .auto-style20 {
    width: 1170px;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
    font-size: small;
    font-family: "Lucida Sans", "Lucida Sans Regular", "Lucida Grande", "Lucida Sans Unicode", Geneva, Verdana, sans-serif;
}
    </style>

</head>
<body>
<body style="background-color: #Fcfad3">

    <div>

    <!-- Navigation -->
        <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation" style="background-color: #848482; left: 0; right: 0; top: 0; height: 80px; ">
        <div class="auto-style17">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="auto-style18">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="#">
                    <div>
                    &nbsp;</div>
                </a></div>
            <div style="height: 50px">
            <!-- 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>
                        <a href="http://welshmediation.com/">
                        <span class="auto-style13">HOME</span></a>
                    </li>
<li>
                        <a href="http://welshmediation.com/whymediation.html">
                        <span class="auto-style13">WHY MEDIATE?</span></a>
                    </li>

                    <li>
                        <a href="http://welshmediation.com/howiwork.html">
                        <span class="auto-style13">HOW I WORK</span></a>
                    </li>
                    <li>
                        <a href="http://welshmediation.com/services.html">
                        <span class="auto-style13">MEDIATION SERVICES</span></a>
                    </li>
                    <li>
                        <a href="http://welshmediation.com/about.html">
                        <span class="auto-style13">ABOUT</span></a>
                    </li>

                     <li>
                        <a href="http://welshmediation.com/helpful.html">
                        <span class="auto-style13">HELPFUL RESOURCES</span></a>
                    </li>
                </ul>
            </div>
            <!-- /.navbar-collapse -->
            </div>
        </div>
        <!-- /.container -->
    </nav>

    <!-- Page Content -->
    </div>

最佳答案

您没有包含 jquery js 文件和 bootstrap js 文件,这就是为什么它没有在您接受时运行 请包含然后尝试。

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
 <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>

您应该在 @media screen and (min-width:0) and (max-width:479px){} 中像这样更新您的 CSS对于手机。

<div>上课"bs-example-navbar-collapse-1"应该style="height: 50px; width: 25%;"

.navbar-fixed-top .nav {
    background: #000 none repeat scroll 0 0;
    float: left;
    padding: 15px 0;
    width: auto;
}
.navbar-fixed-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse
{
    float: left;
    max-height: 340px;
}

关于html - 菜单不适用于移动设备,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36479580/

相关文章:

css - 防止在 Chrome 中突出显示 Canvas 区域

css - 尝试使用 CSS 'label' 隐藏 HTML 'hide'

javascript - 如何使用 $stateProvider 更改选项卡的内容?

javascript - 防止双击图像映射区域

javascript - 如何做一个 GWT-Wrapper

html - 如何使用 css 将图标颜色更改为关注单击联系表 7

javascript - 如何将单选按钮更改为 Bootstrap 按钮

html - 在所有屏幕尺寸上将图像 block 居中

jquery - Fancybox:从事件覆盖中链接到另一个内联 html div

python - 二维数组 Django