bootstrap 3 radio button broke IE

心不动则不痛 提交于 2019-12-25 07:19:29

问题


<form method="post" role="form" class="form-horizontal">
<div class="form-group">
    <div class="radio">
        <label class="control-label col-sm-2">
            <input type="radio" name="selectDate" id="date" style="margin-right: 0" checked>Date</label>
        <div class="col-sm-3">
            <input type="text" class="form-control" id="startDate">
        </div>
        <div style="float:left">:</div>
        <div class="col-sm-3">
            <input type="text" class="form-control" id="endDate">
        </div>
    </div>
</div>

My radio button display normal with chrome, edge, ff, but in old IE its broken - button and label not close together.

I try to use jsfiddle but radio not display when I use IE. plz help me.

https://jsfiddle.net/pLvop1ws/2/


回答1:


Don't use Check box and Radio button in form-group class. Here i wrote it again. Please use this and tell me again your issue..

<form method="post" role="form" class="form-horizontal">
    <div class="radio">
        <label class="control-label col-sm-2">
            <input type="radio" name="selectDate" id="date" style="margin-right: 0" checked>Date</label>

        <div class="form-group">
          <div class="col-sm-3">
            <input type="text" class="form-control" id="startDate">
          </div>
          <div style="float:left">:</div>
          <div class="col-sm-3">
            <input type="text" class="form-control" id="endDate">
          </div>
      </div>
    </div>
</form>



回答2:


Ok try this one. I edit it

<form method="post" role="form" class="form-horizontal">
  <div class="radio">
    <div class="form-inline">
      <label>
        <input type="radio" name="selectDate" id="date" style="margin-right: 0" checked>Date
      </label>

      <div class="form-group">
        <div class="col-sm-3">
          <input type="text" class="form-control" id="startDate">
        </div>
      </div>
      :
      <div class="form-group">
        <div class="col-sm-3">
          <input type="text" class="form-control" id="endDate">
        </div>
      </div>
    </div>
  </div>
</form>



回答3:


Remove "control-label" class and allign
Working code:

<form method="post" role="form" class="form-horizontal">
    <div class="form-group">
        <div class="radio">
            <label class="col-sm-2" style="padding-left:10%">
                <input type="radio" name="selectDate" id="date" style="margin-right: 0" checked>Date</label>
            <div class="col-sm-3">
                <input type="text" class="form-control" id="startDate">
            </div>
            <div style="float:left">:</div>
            <div class="col-sm-3">
                <input type="text" class="form-control" id="endDate">
            </div>
        </div>
    </div>
</form>


来源:https://stackoverflow.com/questions/38822079/bootstrap-3-radio-button-broke-ie

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!