[英]Adjust Buttons in Internet Explorer 11 (CSS, HTML, Bootstrap)
I have the following Code written in HTML and Angular:我有以下用 HTML 和 Angular 编写的代码:
<form [formGroup]="form">
<div class="modal-header">
<span class="modal-title">...</span>
<button type="button" class="close" aria-label="Close" (click)="dismiss()">
<fa-icon class="option-svg" icon="times"></fa-icon>
</button>
</div>
<div class="modal-body">
<div class="row form-group mt-3">
<div class="col-12">
<div>
<p>...</p>
</div>
<div>
<div class="col-6 form-group">
<select class="form-control" formControlName="selectedReason"
id="selectedReason" name="selectedReason">
<option *ngFor="let option of reasons" [ngValue]="option.text">{{option.text}}</option>
</select>
</div>
</div>
<div *ngIf="isOther()">
<div class="col-sm-6 col-lg-12">
<input class="form-control" id="other" type="text" aria-describedby="other" formControlName="other">
</div>
</div>
</div>
</div>
<div class="row form-group">
<div class="col-12">
<p class="warning-message">Wollen Sie das Image wirklich produktiv schalten?</p>
</div>
</div>
</div>
<div class="modal-footer">
<div class="row form-group">
<div class="col-6">
<button type="button" class="btn btn-secondary" (click)="dismiss()">Cancel</button>
<button type="button" class="btn btn-primary" (click)="close()" id="swapImage">Swap</button>
</div>
</div>
</div>
</form>
While testing it on Google Chrome, it works just fine and the buttons are as intended next to each other.在谷歌浏览器上测试时,它工作得很好,按钮彼此相邻。 On Internet Explorer though, the Swap button is underneath the other button.
但在 Internet Explorer 上,“交换”按钮位于另一个按钮下方。 How can I fix this?
我怎样才能解决这个问题? :/
:/
Is there any other CSS style?还有其他 CSS 样式吗? Which version of Bootstrap and angular version are you using?
您使用的是哪个版本的 Bootstrap 和 angular 版本? I have test your code on my side using Bootstrap 4 version, it seems that everything work well on my side(using IE11).
我已经使用 Bootstrap 4 版本在我这边测试了您的代码,看来我这边一切正常(使用 IE11)。 Can you post enough code to reproduce the problem?
你能发布足够的代码来重现问题吗? And, you could also F12 developer tools to check the html resource and CSS style(especially the button and it's container's width property).
而且,您还可以使用 F12 开发人员工具来检查 html 资源和 CSS 样式(尤其是按钮及其容器的宽度属性)。
Besides, you can also change the following code:此外,您还可以更改以下代码:
<div class="row form-group">
<div class="col-6">
<button type="button" class="btn btn-secondary" (click)="dismiss()">Cancel</button>
<button type="button" class="btn btn-primary" (click)="close()" id="swapImage">Swap</button>
</div>
</div>
to到
<div class="row form-group">
<div class="col-3">
<button type="button" class="btn btn-secondary" (click)="dismiss()">Cancel</button>
</div>
<div class="col-3">
<button type="button" class="btn btn-primary" (click)="close()" id="swapImage">Swap</button>
</div>
</div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.