doutu9810 2019-02-05 09:32 采纳率: 0%
浏览 177
已采纳

在PHP模式窗体中更改文本的颜色

I have a modal form where I ask people to input information. Up to recently, it has been behaving perfectly now some of the text won't show because the default colour has changed.

The text used to default to black on a white background. I can see the text by highlighting. I have tried changing the text colours but nothing is working. I am baffled as I have not changed this code in months. Not sure why this has changed.

You can see an example in the code I have posted where I have tried to set the text colour to #333333 but there is no change.

The expected colours are a white background with black text.

<div id="myModal" class="modal fade" role="dialog">
    <div class="modal-dialog">

        <!-- Modal content-->
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Pricing</h4>
            </div>
            <div class="modal-body pricing">


                <div class="row" style="background-color: #333333; color: white;text-align: center;line-height: 35px">
                    <div class="col-lg-7">Item</div>
                    <div class="col-lg-2">Qty</div>
                    <div class="col-lg-3">Price</div>
                </div>
                <form>


                    <div class="row itemlabel">
                        <div class="col-lg-7"><style ="color:DodgerBlue;">Blocks [ Size : 10 pixels X 10 pixels : Min 1 - Max 49]</div>
                        <div class="col-lg-2"><input class="form-control" type="number" value="1" min="1" max="49" id="blockCount"/> </div>

                     <div class="col-lg-3"></div>

                     </div>


                    <div class="row itemlabel">
                        <div class="col-lg-7">Add Logo</div>
                        <div class="col-lg-2"><input class="form-control" type="checkbox" value="1" id="addLogo"/> </div>
                        <div class="col-lg-3" id="addLogoPrice">1.00 USD</div>
                    </div>

                    <div class="row itemlabel">
                        <div class="col-lg-7">Add Sticker "Currently FREE to change" <a target="_blank" href="<?php echo get_site_url().'/stickers';?>" class="badgesHelp" data-toggle="tooltip" title="" data-rel="tooltip">&nbsp;<i class="fa fa-question-circle"></i> </a></div>
                        <div class="col-lg-2"><input class="form-control" type="checkbox" value="1" id="addBadge"/> </div>
                        <div class="col-lg-3" id="addBadgePrice">0.50 USD</div>
                    </div>

                    <div class="row itemlabel">
                        <div class="col-lg-7">Add Link</div>
                        <div class="col-lg-2"><input class="form-control" type="checkbox" value="1" id="addLink"/> </div>
                        <div class="col-lg-3" id="addLinkPrice">1.00 USD</div>
                    </div>

                    <div class="row" style="background-color: #333333; color: white;text-align: center;line-height: 35px">
                        <div class="col-lg-12">Listing Duration</div>
                    </div>

                    <div class="row itemlabel">
                        <div class="col-lg-7">1 Year</div>
                        <div class="col-lg-2"><input class="form-control" type="checkbox" value="1" id="duration1"  /> </div>
                        <div class="col-lg-3" id="duration1Price">1.00 USD</div>
                    </div>

                    <div class="row itemlabel">
                        <div class="col-lg-7">2 Years</div>
                        <div class="col-lg-2"><input class="form-control" type="checkbox" value="1"  id="duration2" /> </div>
                        <div class="col-lg-3" id="duration2Price">2.00 USD</div>
                    </div>

                    <div class="row itemlabel">
                        <div class="col-lg-7">5 Years</div>
                        <div class="col-lg-2"><input class="form-control" type="checkbox" value="1"  id="duration3" /> </div>
                        <div class="col-lg-3" id="duration3Price">5.00 USD</div>
                    </div>

                    <div class="row itemlabel">
                        <div class="col-lg-7"><h4 style="color:DodgerBlue;"><b>Forever   -    "BEST VALUE"</b></h4></div>
                        <div class="col-lg-2"><input class="form-control" type="checkbox" value="1"  id="duration4" /> </div>
                        <div class="col-lg-3" id="duration4Price">15.00 USD</div>
                    </div>

                </form>

                <div class="row" style="font-size: 19px; font-weight: bold; margin-top: 28px;">
                    <div class="col-lg-9" style="text-align: right">Total</div>
                    <div class="col-lg-3" style="text-align: left" id="totalAmount">1.00 USD</div>
                </div>


            </div>
            <div class="modal-footer">
             <div class="errorMsg" style="text-align:center"></div>
                <div class="alert alert-info text-center">You will be able to edit the block and add your story upon successful purchase </div>
                <button type="button" class="btn btn-default" onclick="addDataToCart();">Buy Now</button>
            </div>
        </div>

    </div>
</div>
  • 写回答

1条回答 默认 最新

  • doubi1797 2019-02-07 18:45
    关注

    I managed to fix this with some correct formatting. In the past though it worked perfectly, but now it seems you have explicitly define the text colour when before you did not have to.

    The only reason I can think of is that the version of wordpress that the web site is built from has updated and maybe the underlying version of php has also updated and now you have to explicitly define the colours.

    Here is the updated code:

    <!-- Modal -->
    <!-- Thi is the code for the Buying Blocks Modal Form -->
    
    <div id="myModal" class="modal fade" role="dialog">
        <div class="modal-dialog">
    
            <!-- Modal content-->
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                    <h4 class="modal-title">Pricing</h4>
                </div>
                <div class="modal-body pricing">
    
    
                    <div class="row" style="background-color: #333333; color: white;text-align: center;line-height: 35px">
                        <div class="col-lg-7">Item</div>
                        <div class="col-lg-2">Qty</div>
                        <div class="col-lg-3">Price</div>
                    </div>
                    <form>
    
    
                        <div class="row itemlabel">
                            <div class="col-lg-7"><p style="color:Black;"><b>Blocks [ Size : 10 pixels X 10 pixels : Min 1 - Max 49]</b></p></div>
                            <div class="col-lg-2"><input class="form-control" type="number" value="1" min="1" max="49" id="blockCount"/> </div>
                            <div class="col-lg-3"></div>
                         </div>
    
    
                        <div class="row itemlabel">
                            <div class="col-lg-7"><p style="color:Black;"><b>Add Logo</b></p></div>
                            <div class="col-lg-2"><input class="form-control" type="checkbox" value="1" id="addLogo"/> </div>
                            <div class="col-lg-3" id="addLogoPrice"><p style="color:Black;"><b>1.00 USD</b></p></div>
                        </div>
    
                        <div class="row itemlabel">
                            <div class="col-lg-7"><p style="color:Black;"><b>Add Sticker "Currently FREE to change" <a target="_blank" href="<?php echo get_site_url().'/stickers';?>" class="badgesHelp" data-toggle="tooltip" title="" data-rel="tooltip">&nbsp;<i class="fa fa-question-circle"></i> </a></b></p></div>
                            <div class="col-lg-2"><input class="form-control" type="checkbox" value="1" id="addBadge"/> </div>
                            <div class="col-lg-3" id="addBadgePrice"><p style="color:Black;"><b>0.50 USD</b></p></div>
                        </div>
    
                        <div class="row itemlabel">
                            <div class="col-lg-7"><p style="color:Black;"><b>Add Link</b></p></div>
                            <div class="col-lg-2"><input class="form-control" type="checkbox" value="1" id="addLink"/> </div>
                            <div class="col-lg-3" id="addLinkPrice"><p style="color:Black;"><b>1.00 USD</div>
                        </div>
    
                        <div class="row" style="background-color: #333333; color: white;text-align: center;line-height: 35px">
                            <div class="col-lg-12">Listing Duration</div>
                        </div>
    
                        <div class="row itemlabel">
                            <div class="col-lg-7"><p style="color:Black;"><b>1 Year</b></p></div>
                            <div class="col-lg-2"><input class="form-control" type="checkbox" value="1" id="duration1"  /> </div>
                            <div class="col-lg-3" id="duration1Price"><p style="color:Black;"><b>1.00 USD</b></p></div>
                        </div>
    
                        <div class="row itemlabel">
                            <div class="col-lg-7"><p style="color:Black;"><b>2 Years</b></p></div>
                            <div class="col-lg-2"><input class="form-control" type="checkbox" value="1"  id="duration2" /> </div>
                            <div class="col-lg-3" id="duration2Price"><p style="color:Black;"><b>2.00 USD</b></p></div>
                        </div>
    
                        <div class="row itemlabel">
                            <div class="col-lg-7"><p style="color:Black;"><b>5 Years</b></p></div>
                            <div class="col-lg-2"><input class="form-control" type="checkbox" value="1"  id="duration3" /> </div>
                            <div class="col-lg-3" id="duration3Price"><p style="color:Black;"><b>5.00 USD</b></p></div>
                        </div>
    
                        <div class="row itemlabel">
                            <div class="col-lg-7"><h4 style="color:DodgerBlue;"><b>Forever   -    "BEST VALUE"</b></h4></div>
                            <div class="col-lg-2"><input class="form-control" type="checkbox" value="1"  id="duration4" /> </div>
                            <div class="col-lg-3" id="duration4Price"><p style="color:Black;"><b>15.00 USD</b></p></div>
                        </div>
    
                    </form>
    
                    <div class="row" style="color:Black; font-size: 19px; font-weight: bold; margin-top: 28px;">
                        <div class="col-lg-9" style="text-align: right">Total</div>
                        <div class="col-lg-3" style="text-align: left" id="totalAmount"><p style="color:Black;"><b>1.00 USD</b></p></div>
                    </div>
    
    
                </div>
                <div class="modal-footer">
                 <div class="errorMsg" style="text-align:center"></div>
                    <div class="alert alert-info text-center">You will be able to edit the block and add your story upon successful purchase </div>
                    <button type="button" class="btn btn-default" onclick="addDataToCart();">Buy Now</button>
                </div>
            </div>
    
        </div>
    </div>
    

    It could be another reason but not sure. I don't have the knowledge to track such things.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘