Bootstrap 3 Horizontal Form / IE8 Support

2019-08-09 10:59发布

问题:

So I'm working on a website using Bootstrap 3. This website needs to render properly in IE8 (yes I know). I'm working on a horizontal form right now. Used the code provided by Bootstrap documentation:

<form class="form-horizontal" role="form">
    <div class="form-group">
    <label for="inputEmail1" class="col-lg-2 control-label">Email</label>
    <div class="col-lg-10">
    <input type="email" class="form-control" id="inputEmail1" placeholder="Email">
    </div>
    </div>
<div class="form-group">
<label for="inputPassword1" class="col-lg-2 control-label">Password</label>
<div class="col-lg-10">
  <input type="password" class="form-control" id="inputPassword1" placeholder="Password">
</div>
</div>
<div class="form-group">
<div class="col-lg-offset-2 col-lg-10">
  <div class="checkbox">
    <label>
      <input type="checkbox"> Remember me
    </label>
  </div>
</div>
</div>
<div class="form-group">
<div class="col-lg-offset-2 col-lg-10">
  <button type="submit" class="btn btn-default">Sign in</button>
</div>
</div>
</form>

And noticed it does not display properly in IE8. Even by going to the documentation URL:

http://getbootstrap.com/css/#forms-horizontal

does not display properly in IE8.

Do I have to write forms in a specific format in order to make them work in IE8?

Thanks!

回答1:

Take a look at the explanation here: IE8 issue with Twitter Bootstrap 3

You'll need to add respond.js to your site for IE8 to process media queries. https://github.com/scottjehl/Respond

More here: http://getbootstrap.com/getting-started/#browsers