繁体   English   中英

如何在引导程序中将表单输入标签和段落的文本颜色更改为白色

[英]How to change text color to white for form input labels and paragraphs in bootstrap

嗨,我在全屏视频上方有一个注册表单。 我正在使用Bootstrap,我不知道如何为表单标签和表单旁边的段落获取白色文本颜色。 我对Bootstrap还是很陌生,到目前为止我只发现颜色,该段落类的颜色与我的设计冲突,我只需要获取白色即可,但是我不知道该怎么做。 我意识到这可能很简单,我对此表示歉意,如果是这样的话,我事先表示歉意。 任何帮助将不胜感激。

这是我的代码:

<div class="container-fluid">
<section class="container">
    <div class="container-page">                
        <div class="col-md-6">
            <h3 class="dark-grey">Registration</h3>

            <div class="form-group col-lg-12">
                <label>Username</label>
                <input type="" name="" class="form-control" id="" value="">
            </div>

            <div class="form-group col-lg-6">
                <label>Password</label>
                <input type="password" name="" class="form-control" id="" value="">
            </div>

            <div class="form-group col-lg-6">
                <label>Repeat Password</label>
                <input type="password" name="" class="form-control" id="" value="">
            </div>

            <div class="form-group col-lg-6">
                <label>Email Address</label>
                <input type="" name="" class="form-control" id="" value="">
            </div>

            <div class="form-group col-lg-6">
                <label>Repeat Email Address</label>
                <input type="" name="" class="form-control" id="" value="">
            </div>          

            <div class="col-sm-6">
                <input type="checkbox" class="checkbox" />Sigh up for our newsletter
            </div>

            <div class="col-sm-6">
                <input type="checkbox" class="checkbox" />Send notifications to this email
            </div>              

        </div>

        <div class="col-md-6">
            <h3 class="dark-grey">Terms and Conditions</h3>
            <p>
                By clicking on "Register" you agree to The Company's' Terms and Conditions
            </p>
            <p>
                While rare, prices are subject to change based on exchange rate fluctuations - 
                should such a fluctuation happen, we may request an additional payment. You have the option to request a full refund or to pay the new price. (Paragraph 13.5.8)
            </p>
            <p>
                Should there be an error in the description or pricing of a product, we will provide you with a full refund (Paragraph 13.5.6)
            </p>
            <p>
                Acceptance of an order by us is dependent on our suppliers ability to provide the product. (Paragraph 13.5.6)
            </p>

            <button type="submit" class="btn btn-primary">Register</button>
        </div>
    </div>
</section>
</div>

您可以如下将白色应用于标签和p标签

.form-group label, p{
  color: #fff;
}

它不起作用使用!important

.form-group label, p{
  color: #fff!important;
}

这应该很简单:

body {
  background-color: black;
}
p,label {
  color: white;
}

在此处查看codepen: http ://codepen.io/BoyWithSilverWings/pen/NbjOgJ

应该这样做:

form, input, label, p {
    color: white !important;
}

在大多数情况下,使用引导程序时,将需要!important覆盖现有的引导程序CSS样式。

暂无
暂无

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

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