Using d-flex and flex-wrap in Internet Explorer 11
我已经知道之前曾有人问过这个问题,我尝试了提供的不同答案,但是似乎没有一个在我的代码上起作用。
我正在修复在Chrome和Firefox中的两列中显示的一系列输入,但在IE11中不显示。
这是在Chrome浏览器上的外观
这是在IE11上的外观
这是正在使用的代码
1 2 3 4 5 | <div *ngFor="let field of fieldsToDisplay;let i = index" ng-class="'address-single-div-class w-100': field.FieldType.toString() == FieldType_Type.Textarea.toString(), 'address-single-div-class': field"> <input-field *** series of inputs *** </input-field> |
好,所以我通过在第二个具有输入字段的div中添加
显然,由于某些错误,
尝试为输入字段添加
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | <!DOCTYPE html> <html lang="en"> <head> Bootstrap Example <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"> </head> <body> <p><center>[wp_ad_camp_2]</center></p><p>Use .flex-fill on flex items to force them into equal widths:</p> <input type="text" class="p-2 flex-fill form-control col-4" value="Flex item 1" /> <input type="text" class="p-2 flex-fill form-control col-4" value="Flex item 2" /> <input type="text" class="p-2 flex-fill form-control col-4" value="Flex item 3" /> <input type="text" class="p-2 flex-fill form-control col-4" value="Flex item 4" /> </body> </html> |
在IE11浏览器中的结果: