繁体   English   中英

超小型设备中的引导列问题

[英]Problems with bootstrap columns in extra small devices

我在超小型设备上的引导列上遇到问题。 在超小型设备中,引导程序列会溢出并更改对齐方式。

我正在附加来自超小型设备和其他设备的屏幕截图。

小型设备的屏幕截图: 在此处输入图片说明

其他设备的屏幕截图(工作正常): 在此处输入图片说明

下面的代码是引导代码。

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <link rel="stylesheet" href="manu.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container-fluid">

<div class="header row"> 
<div class="time_remain col-sm-6 col-xs-6 col-md-6 col-ld-6">00 Min 00 Sec</div>

<div class="logout col-sm-6 col-xs-6 col-md-6 col-ld-6">Logout</div>
</div>



  <div class="row frame">
    <div class="col-sm-9 col-xs-9 col-md-9 col-ld-9 question_wrapper">

            <div class="row questions">
                1. This is first one?        
            </div>

            <div class="row no-gutters choice_label_choice">            
                <div class="col-sm-1 col-xs-1 col-md-1 col-ld-1 answer_choice_label_div">
                A
                </div>
                <div class="col-sm-11 col-xs-11 col-md-11 col-ld-11 answer_choice_div">
                First
                </div>

            </div>




            <div class="row no-gutters choice_label_choice">
                <div class="col-sm-1 col-xs-1 col-md-1 col-ld-1 answer_choice_label_div">
                B
                </div>

                <div class="col-sm-11 col-xs-11 col-md-11 col-ld-11 answer_choice_div">
                    Second
                </div>
            </div>


            <div class="row no-gutters choice_label_choice">
                <div class="col-sm-1 col-xs-1 col-md-1 col-ld-1 answer_choice_label_div">
                    C
                </div>

                <div class="col-sm-11 col-xs-11 col-md-11 col-ld-11 answer_choice_div">
                    Third
                </div>
            </div>

            <div class="row no-gutters choice_label_choice">
            <div class="col-sm-1 col-xs-1 col-md-1 col-ld-1 answer_choice_label_div">
                D
            </div>

            <div class="col-sm-11 col-xs-11 col-md-11 col-ld-11 answer_choice_div">
                Fourth
            </div>
            </div>      
      </div>    
    <div class="col-sm-3 col-xs-3 col-md-3 col-ld-3 question_status_wrapper">.col-sm-3</div>
  </div>

    <div class="row status_bar">
    <div class="col-sm-3 col-xs-3 col-md-1 col-ld-1 time_bar"><div>00 MIN 00 SEC</div> </div>
    <div class="col-sm-3 col-xs-3 col-md-1 col-ld-1 time_bar"><div>Back</div></div>
    <div class="col-sm-3 col-xs-3 col-md-1 col-ld-1 time_bar"><div>Next</div></div>
    <div class="col-sm-0 col-xs-0 col-md-6 col-ld-6 "></div>
    <div class="col-sm-3 col-xs-3 col-md-1 col-ld-1  time_bar"><div>Submit</div></div>
    </div>


</div>

</body>
</html>

css代码如下。

.frame
{
    height: 70vh;
}

.question_wrapper
{
    height: inherit;
    background-color: beige;
    overflow: auto;
    padding-left: 20px;
    padding-right: 20px;

}
.time_remain
{
padding-top: 5px;
color: white;
text-align: left;
padding-left: 20px;

}

.logout
{
    color: white;
    text-align: right;
    padding-right: 20px;
    padding-top: 5px;

}

.question_status_wrapper
{
    height: inherit;
    background-color: bisque;
    overflow: auto;
}

.header
{
    height: 10vh;
    background-color: #333333;
    color: white;
}

.status_bar
{
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 20vh;
    background-color : #333333;
    display: flex;
}

.questions
{
    margin-top: 20px;
    margin-left: 20px;
}

.answer_choice_label_div
{
    background-color: black;
    color: white;
    text-align: center;
    height: inherit;
    vertical-align: inherit;
    border-style: solid;
    border-width: 2px;
}

.answer_choice_div
{
    background-color: white;
    color: black;
    height: inherit;
    vertical-align: inherit;
    border-style: solid;
    border-width: 2px;
    overflow: inherit;
}

.answer_choice_div:hover
{
    background-color: #C6FFF1;
    color: black;
    height: inherit;
    vertical-align: inherit;
    border-style: solid;
    border-width: 2px;
    overflow: inherit;
}

.choice_label_choice
{
    margin-top: 10px;
    margin-bottom: 10px;
    min-height: 10vh;
    height: 50px;
    vertical-align: middle;
}

.time_bar
{
    background-color: aliceblue;
    color: black;
    align-self: center;
    text-align: center;
    margin-left: 10px;
    min-height: 6vh;
    display: inline;
    vertical-align: middle;
    margin-right: 10px;
    padding-top: 7px;
}

我检查了引导网格,没有发现任何问题。 请帮忙。

使用媒体查询,将此代码粘贴到您的style.css中

@media only screen and (max-width: 580px) 
 {
  .answer_choice_div 
       {
        width: 83%;
            }
    .answer_choice_label_div
          {

           width: 10%;
          }
  }

将xs用于超小型设备。 sm用于小型设备,md用于中型设备。

点击此链接获取网格选项

网格选项-引导程序

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM