Bootstrap 4为小屏幕删除了CSS样式?

时间:2018-04-23 01:51:51

标签: css responsive-design bootstrap-4

我已经离开了网络开发领域多年,我正在重新开始使用Bootstrap 4开发一个网站。

这可能是一个愚蠢的问题,但我有一些CSS样式用于某些表单元素的复选框以及减少屏幕大小< 768px的造型消失了......

这是Bootstrap的基础(虽然没有任何其他CSS样式元素发生这种情况吗?)或者我做的事情显然是错误的?

以下是一些代码段:

.question input {
   position: absolute;
   left: -9999px;
 }

.question label {
   display: block;
   position: relative;
   margin: 5px;
   padding: 15px 30px 15px 55px;
   border: 3px solid #fff;
   border-radius: 20px;
   color: #fff;
   background-color: #005552;
   white-space: pre-wrap;
   cursor: pointer;
   user-select: none;
   transition: background-color .2s, box-shadow .2s;
}

.question label::before {
   content: '';
   display: block;
   position: absolute;
   top: 10px;
   bottom: 10px;
   left: 10px;
   width: 32px;
   border: 3px solid #fff;
   border-radius: 20px;
   transition: background-color .2s;
}

.question input:checked + label {
   background-color: #ab576c;
 }

 .question input:checked + label::before {
    background-color: #fff;
  }

  <form target="nextQuestion.php" action="post" style="margin-bottom: 0px;">
        <input type="hidden" name="percentage" id="percentage">
        <input type="hidden" name="currentQuestion" id="currentQuestion" value="1">         
        <div class="container-fluid">   
            <div class="row">
                <div class="col-12 my-auto toxic-red-background" align="center">
                    <h6 class="white-text">Your Progress Through Our Questionnaire: </h6>
                    <div class="progress">
                        <div class="progress-bar-animated bg-primary" role="progressbar" style="width: 5%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-12 toxic-teal-background questionnaire-left-section question">
                    <h3>Q1: Would you use out website again?</h3>
                    <p>&nbsp;</p>
                    <input type="hidden" value="Question2">
                    <input id="yes" type="checkbox" class="QuestionnaureInput">
                    <label for="yes" class="QuestionnaireLabel">Yes</label>
                    <input id="no" type="checkbox" class="QuestionnaureInput">
                    <label for="no" class="QuestionnaireLabel">No</label>
                    <input id="maybe" type="checkbox" class="QuestionnaureInput">
                    <label for="maybe" class="QuestionnaireLabel">Maybe</label>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12 clearfix">
                    <button class="btn btn-primary mb-2 float-left">Prev</button>
                    <button type="submit" class="btn btn-primary mb-2 float-right">Next</button>
                </div>
            </div>
        </div>
    </form>

以下是一些屏幕抓取来说明正在发生的事情:

On larger screen - All OK

Screen resized to < 768px and styling is removed

任何建议,答案或指导都感激不尽,因为我要拔头发!!

提前致谢!

0 个答案:

没有答案