简体   繁体   English

引导选择框样式冲突

[英]bootstrap select box styling conflict

I am re-styling an existing website, and have come across the following strange error. 我正在重新设计现有网站的样式,并遇到以下奇怪的错误。 The select boxes have an overlapping white space where the option values are. 选择框在选项值所在的地方有一个重叠的空白。 I am attaching an image. 我正在附加图像。 Image of select box with white space 带有空白的选择框的图像

I am using bootstrap to do the new styling. 我正在使用bootstrap进行新样式设计。 Code example follows: 代码示例如下:

        <div class="form-group">
            <label class="control-label" for="truckName">Truck:</label>
            <select class="form-control" name="truckName" id="truckName">
                @foreach (var truck in ViewBag.trucks)
                {
                    <option value="@truck.id">@truck.name</option>

                }
            </select>
        </div>

Any idea where I might look to resolve this issue would be very much appreciated. 我非常希望能解决这个问题的任何想法。

Your snap appears as if the site has some pluigin or code to modify your select boxes as select box does not appear as in your snap. 您的快照看起来像网站上有一些习俗或代码来修改您的选择框,因为选择框并不像您的快照中所示。 If you look into your code (on client side, using inspect element feature of browser) you will get that there is some span/div has been used which is overlapping or producing the white background/white space over the select element. 如果您查看代码(在客户端,使用浏览器的检查元素功能),则会发现已使用了一些span / div,该span / div与select元素重叠或产生白色背景/空白。

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

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