Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 各种屏幕上的导航条尺寸_Html_Css_Twitter Bootstrap - Fatal编程技术网

Html 各种屏幕上的导航条尺寸

Html 各种屏幕上的导航条尺寸,html,css,twitter-bootstrap,Html,Css,Twitter Bootstrap,我正在尝试制作一个导航栏,它将在我的网站上运行。不幸的是,在较小的屏幕上,顶部的按钮会在黑条下方弹出。我已经试了又试了,但运气不好。如何使导航栏的各个方面在大屏幕、中屏幕和小屏幕上保持一致 <!--Navigation with Button --> <?php if(session_status()!==PHP_SESSION_ACTIVE) session_start(); include "header.php"; if(isset($_POST['search

我正在尝试制作一个导航栏,它将在我的网站上运行。不幸的是,在较小的屏幕上,顶部的按钮会在黑条下方弹出。我已经试了又试了,但运气不好。如何使导航栏的各个方面在大屏幕、中屏幕和小屏幕上保持一致

<!--Navigation with Button -->
<?php
if(session_status()!==PHP_SESSION_ACTIVE)
    session_start();
include "header.php";

if(isset($_POST['search']))
    $search = $_POST['search'];
else
    $search = "";
?>

    <nav id="topbar" class="navbar navbar-default navbar-fixed-top">
        <div class="container-fluid">

            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">


                <a class="navbar-brand" href="/"><img src="img/logo_front.png" alt=""></a>



                <form id="searchme" class="navbar-form pull-left" role="search" action="search.php" method="post">
                    <div class="input-group" display="inline" id="topinput">
                        <input id="topbarsearch" name="search" type="search" value="<?php echo $search;?>" class="form-control" placeholder="Name">
                        <span class="input-group-btn" id='search_btn'>
                            <button id="searchicon" name="submit" class="btn btn-lg" type="submit">
                                <span class="glyphicon glyphicon-search" name="submit"></span>
                            </button>    
                    </div>  
                </form>

            <!--Button to Upload Information -->

            <div class="top_container">
                <div class="call-to-action">

                <div id="uploadbutton" class="nav navbar-right">    
                 <?php
                    if(isset($_SESSION['userid']) && $_SESSION['userid']!=''){
                 ?>
                      <a href="signout.php" id="logout" class="btn btn-m"><?php echo $_SESSION['username'] . " Sign Out";?></a>
                 <?php
                    }
                     ?>

                    <a class="btn btn-secondary" href="about.php" id="about_button_topbar">About Us</a> 

                    <a class="btn btn-info" href="create.php" id="signin_button_topbar">Sign In</a>

                    <a href="upload_choice.php" role="button" id="mybutton" class="btn btn-success">Upload</a>

                </div>

            </div>

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

    <!-- End Navigation with Button -->

///CSS

    #topbar{
    background-color: rgba(0,0,0,.8);
    height:60px;
    display:inline-block;
    white-space:nowrap;
    padding-left:20px;
    padding-right:20px;
    }


    .navbar-default {
    border-color: rgba(34,34,34,.05);
    font-family: 'Open Sans','Helvetica Neue',Arial,sans-serif;
    background-color: transparent;
    border:none;
    display:block;
    height:100px;
    -webkit-transition: all .35s;
    -moz-transition: all .35s;
    transition: all .35s;

    }

    #mybutton{
    padding-top:10px;
    margin-right:-60px;
    float:right;
    height:45px;

    }

    #signin_button_topbar{
    padding-top:10px;
    height:45px;
    margin-right:15px;

    }

    #about_button_topbar{
    padding-top:10px;
    height:45px;
    margin-right:15px;
    color:white;
   }

///CSS
#顶栏{
背景色:rgba(0,0,0,8);
高度:60px;
显示:内联块;
空白:nowrap;
左侧填充:20px;
右边填充:20px;
}
.navbar默认值{
边框颜色:rgba(34,34,34,05);
字体系列:“开放式Sans”、“Helvetica Neue”、Arial、Sans serif;
背景色:透明;
边界:无;
显示:块;
高度:100px;
-webkit转换:全部.35秒;
-moz转换:全部.35s;
过渡:全部.35s;
}
#我的按钮{
填充顶部:10px;
右边距:-60px;
浮动:对;
高度:45px;
}
#登录按钮顶栏{
填充顶部:10px;
高度:45px;
右边距:15px;
}
#关于按钮顶部栏{
填充顶部:10px;
高度:45px;
右边距:15px;
颜色:白色;
}
您可以将其作为一种技术来帮助处理该问题。有很多,你必须做一些游戏来得到你想要的,特别是。但是,举个简单的例子:

这个想法是,在CSS中,您可以设置一个媒体查询来帮助确定屏幕大小。媒体查询只不过是一个简单的过滤器,基本上说:

if (screen == big) 'use this css'
else if (screen == small) 'use this css'
我将尝试在下面插入一个示例,您可以简单地测试我的意思,或者使您的浏览器窗口大小不同,或者打开开发人员工具并将布局更改为不同的移动模拟。(如果您不知道如何执行此操作,请参阅)

经过一点测试后,我发现最好单击运行代码段时出现在代码段右上角的完整页面按钮

#a,#b{颜色:#f8f8ff;填充:1em;文本对齐:居中;}
@介质(最小宽度:640像素){
#a{背景:蓝色;}
#b{边框顶部:1px实心;}
}
@介质(最大宽度:640像素){
#a{背景:红色;}
}
#b{背景:红色;}

大的时候这是一个蓝色的Div
但是当它变小的时候,它会变成和这个div一样的红色
您可以将其作为一种技术来帮助处理该问题。有很多,你必须做一些游戏来得到你想要的,特别是。但是,举个简单的例子:

这个想法是,在CSS中,您可以设置一个媒体查询来帮助确定屏幕大小。媒体查询只不过是一个简单的过滤器,基本上说:

if (screen == big) 'use this css'
else if (screen == small) 'use this css'
我将尝试在下面插入一个示例,您可以简单地测试我的意思,或者使您的浏览器窗口大小不同,或者打开开发人员工具并将布局更改为不同的移动模拟。(如果您不知道如何执行此操作,请参阅)

经过一点测试后,我发现最好单击运行代码段时出现在代码段右上角的完整页面按钮

#a,#b{颜色:#f8f8ff;填充:1em;文本对齐:居中;}
@介质(最小宽度:640像素){
#a{背景:蓝色;}
#b{边框顶部:1px实心;}
}
@介质(最大宽度:640像素){
#a{背景:红色;}
}
#b{背景:红色;}

大的时候这是一个蓝色的Div
但是当它变小的时候,它会变成和这个div一样的红色

您的问题可以用解决您的问题可以用