禁用HTML选择选项

时间:2015-03-11 14:16:32

标签: html select

我的选项框在Chrome和Firefox中已停用。但它适用于Internet Explorer吗?
有人可以查看我的代码并告诉我我做错了什么吗?
感谢

<div class="col-lg-7 input-group">						
    <select id="globalSelect" class="form-control" style="background-color: white; color: grey;">
        <option>Quarterly</option>
        <option>Monthly</option>
    </select>
</div>

4 个答案:

答案 0 :(得分:1)

所以,firefox和chrome似乎没有解决重叠col的问题。我在col7之后添加了一个br,所以它不会与col12重叠,它可以工作!

<div id="global" class="tab-pane fade">
              <div class="row">

                    <div class="col-lg-7 input-group">

                      <select id="globalSelect" class="form-control" style="background-color: white; color: grey;">
                          <option>Quarterly</option>
                          <option>Monthly</option>
                        </select>
                    </div>
                <br /><br /><br /><br /><br /><br />
              <div class="content container">
                <div class="col-lg-12">
                  <div class="row">
                    <div class="col-lg-12">
                      <div class="widget">
                        <div class="widget-header"> <i class="icon-bar-chart"></i>
                          <h3>Global turnover VAT incl.</h3>
                        </div>
                        <div class="widget-content">
                          <div id="chartGlobal" class="jqplot-chart" style="width:100%; height:350px"></div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            </div>

感谢您的所有评论。

答案 1 :(得分:0)

您的代码中没有错误 只需检查你的chrome和firefox版本是最新的。

如果您仍有问题,请提供有用的详细代码。

答案 2 :(得分:0)

我不确定你到底在找什么,但我认为浏览器版本不是问题。当你使用html和css的基本元素时。

以下是您可能想要实现的三种不同的选择元素。

    
    Disabled: 
    <select id="globalSelect" class="form-control" disabled="true">
                <option>Quarterly</option>
                <option>Monthly</option>
    </select>

    <br/>
    <br/>

    Styled like disabled:
    <select id="globalSelect" class="form-control" style="background-color: white; color: grey;">
            <option>Quarterly</option>
            <option>Monthly</option>
    </select>


    <br/>
    <br/>

    Active:
    <select id="globalSelect" class="form-control">
                <option>Quarterly</option>
                <option>Monthly</option>
    </select>

答案 3 :(得分:-1)

您没有禁用您的选项框,您只需设置一个不同的样式,使其看起来已禁用。根据您使用的软件版本,Internet Explorer可能支持也可能不支持样式select元素。

尝试使用disabled属性:

<select id="globalSelect" class="form-control">
  <option disabled="disabled" value="quarterly">Quarterly</option>
  <option disabled="disabled" value="monthly">Monthly</option>
</select>
相关问题