html - Chrome/Firefox 与 IE 的不同定位

标签 html css cross-browser css-float

我有以下布局:-

html:-

 <header>
    <div class="content-wrapper">
        <div id="headerContainer">
            <div class="headerProfileNotifications">
                <img src="Images/" alt="notification" />
            </div>
            <div class="headerProfilePhoto">
                <img src="Images/" alt="profile_photo" />
            </div>
            <div class="headerProfileDetails">
                <div class="headerProfileName">John Smith</div>
                <div class="headerProfileEmail">john.smith@someemail.co.uk</div>
            </div>
        </div>
    </div>
</header>

和 css:-

    header {
    padding-bottom: 5px;
   }

    #headerContainer {
    height: 33px;
    background-position: 10px 2px;
    padding-top: 2px;
   }


    .headerProfileNotifications {
    float: right;
    height: 22px;
    width: 29px;
    padding-right: 4px;
    margin: 5px;
   }

    .headerProfilePhoto {
    float: right;
    height: 33px;
    width: 22px;
    margin: 5px;
   }


    .headerProfileDetails {
    float: right;
    padding-right: 4px;
    font-size: 11px;
   }

    .headerProfileName {
    margin-top: 2px;
    float: right;
   }


    .headerProfileEmail {
    margin-top: 0px;
   }

JSFiddle

但是它在 Chrome/Firefox 中看起来是一样的, 并且它看起来应该是这样,但是在 IE 中, 它显示不同。

我必须将什么 css 应用到 IE 才能看起来与 Chrome/Firefox 完全一样?

感谢您的帮助和时间

最佳答案

这样就可以了:

  .headerProfileEmail {
    clear:both;
    float:right;
    margin-top: 0px;
   }

关于html - Chrome/Firefox 与 IE 的不同定位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15611912/

相关文章:

javascript - 如何使用 javascript 将 div 标签数据设置为 li 标签?

html - 为什么 Material Design Top App Bar 与顶部的差距很小?

javascript - IE 中的 XPath 查询使用从零开始的索引,但 W3C 规范是从一开始的。我应该如何处理差异?

javascript - 如何在表单提交之前进行验证并显示消息?

javascript - jQuery(或只是 JS)从 onSubmit 函数中的多个表单提交按钮中选择

php - 我的 custom.css 文件显示不同的 ssl 和非 ssl url magento 2

css - div 总是正确的,所有浏览器

html - 在没有flexbox的情况下并排对齐三个div

html - 样式化的复选框在表中重叠

javascript - 在 Android 上使用 PhoneGap 进行地理定位仅适用于 index.html