简体   繁体   English

Bootstrap 和 Internet Explorer 11 问题

[英]Bootstrap & Internet Explorer 11 issues

So I'm having a small formatting problem with my Internet Explorer 11.所以我的 Internet Explorer 11 有一个小的格式问题。

Here is the picture from Google Chrome (THIS IS PERFECT):这是谷歌浏览器的图片(这是完美的):

在此处输入图片说明

Here is the picture from Internet Explorer 11这是 Internet Explorer 11 中的图片

在此处输入图片说明

Here is the code:这是代码:

 .bottomRightBox { height: 170px; width: 310px; /* background-color: #4B92DB; border: 1px black solid; //BOTTOM RIGHT BOX BORDER */ } #contactsPicture { align: left; valign: top; height: 98px; /* padding-top: 10px; //PADDING FOR CONTACT PICTURE */ } #contactImg { width: auto; height: 148px; } .contactsPictureName { color: black!important; font-weight: normal!important; padding-left: 15px!important; padding-top: 2px; } #rightBottomHeading { float: right; clear: right; padding-right:176px; font-size: 18px!important; font-weight: bold!important; }
 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> <div class="col-sm-offset-0 col-sm-12 col-md-4" style="padding-right: 0px;"> <h4 id="rightBottomHeading">Office 365 Contacts</h4> <hr id="bottomRightLineBreaker"/> <div class="bottomRightBox"> <table> <tbody> <tr valign="top" id="ctl00_m_g_63062bfa_96b4_4d90_b7c4_92ac5983dbfe_ctl00_uxGenericListView_ctrl0_ctl09_genericPicRow"> <td id="contactsPicture"> <div class="UserPhoto"> <a href="IMAGE LINK" target="_blank" style="padding-right: 5px;"><img id="contactImg" src="IMAGE URL" alt="A" /></a> <a href="mailto:Portalhelp" style="padding-left: 5px;"><img id="contactImg" src="IMAGE URL" alt="P" /></a> </div> </td></tr> <tr valign="top"> <td style="width: 106px" valign="top"> <div class="contactsPictureName"> <a href="PICTURE LINK" target="_black" style="color: black;"><p id="name" style="width: auto; float: left; clear: none;">NAME</p></a> <a href="URL" style="color: black;"><p id="name" style="width: auto; float: right; clear: none; margin-right: 45px;">PORTALHELP</p></a> </div> </td></tr> </tbody> </table> </div> </div>

Any input with CSS formatting and styling would be highly appreciated.任何带有 CSS 格式和样式的输入都将受到高度赞赏。 Currently using Bootstrap 3.目前使用 Bootstrap 3。

Got it guys!明白了伙计们!

Thanks to Girdharilal and his attempt I was able to use:感谢 Girdharilal 和他的尝试,我能够使用:

 .UserPhoto a { display: -ms-inline-flexbox; }

which ended up working perfectly.最终完美运行。

I would suggest a different approach to your display method.我建议对您的显示方法采用不同的方法。 Rather than relying on a bunch of custom css and float declarations, why not use the Grid for this situation?与其依赖一堆自定义的 css 和float声明,为什么不在这种情况下使用 Grid 呢? Consider the following implementation:考虑以下实现:

 .contactBox { padding-bottom: 1.5rem; }
 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> <div class="container-fluid"> <div class="row"> <!-- The Left Column (Implied but never specified) --> <div class="col-sm-12 col-md-8"> <p>This area is intentionally left blank.</p> </div> <!-- Your Right Column --> <div class="col-sm-12 col-md-4"> <h4>Office 365 Contacts</h4> <div class="row"> <div class="contactBox col-xs-6 col-md-4 text-center"> <a href="#userPhotoLink"><img src="https://placehold.it/250x150" class="img-responsive" /></a> <a href="#userEmailLink">Name</a> </div> <div class="contactBox col-xs-6 col-md-4 text-center"> <a href="#userPhotoLink"><img src="https://placehold.it/250x150" class="img-responsive" /></a> <a href="#userEmailLink">Name</a> </div> <div class="contactBox col-xs-6 col-md-4 text-center"> <a href="#userPhotoLink"><img src="https://placehold.it/250x150" class="img-responsive" /></a> <a href="#userEmailLink">Name</a> </div> <div class="contactBox col-xs-6 col-md-4 text-center"> <a href="#userPhotoLink"><img src="https://placehold.it/250x150" class="img-responsive" /></a> <a href="#userEmailLink">Name</a> </div> </div> </div> </div> </div>

In the above code we're relying more heavily on the Bootstrap 3.x Grid component as well as a few other utility classes.在上面的代码中,我们更多地依赖 Bootstrap 3.x Grid组件以及一些其他实用程序类。 An added bonus is that by relying more heavily on Bootstrap you have an opportunity to offer better responsive behavior.一个额外的好处是,通过更多地依赖 Bootstrap,你有机会提供更好的响应行为。

It really only requires one custom line of CSS;它实际上只需要一行自定义的 CSS; .contactBox ... which is really only there to ensure that you have proper bottom padding without the need to re-iterate row or add line breaks. .contactBox ... 这实际上只是为了确保您有适当的底部填充,而无需重复row或添加换行符。

You may need to expand the snippet to see how the layout can adjust depending on screen resolution.您可能需要展开代码段以查看布局如何根据屏幕分辨率进行调整。 Alternatively, you can view the same code via the following Bootply link: https://www.bootply.com/LK0cVLrCBm或者,您可以通过以下 Bootply 链接查看相同的代码: https ://www.bootply.com/LK0cVLrCBm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM