三星浏览器上的元素大小错误

时间:2015-12-23 08:26:58

标签: android html css samsung-mobile

我们在网站底部有一个粘性cookie通知。它在所有其他浏览器上看起来很好,但是三星的默认浏览器“Internet”显示错误,导致文本元素比它应该更窄。这导致了一个难看的换行符,错位的解散按钮以及粘性元素的不必要的外部高度。

Screenshot on a Galaxy Note 3

我不知道有什么好办法可以解决这个问题,因为它只发生在三星的移动浏览器上,我还没有办法在其上运行任何CSS / DOM检查器。有什么想法吗?

小提琴:https://jsfiddle.net/1m94d99o/4/

body, html {
    width: 100%;
    height: 100%;
    font-family: sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: auto;
    box-sizing: border-box;
}

*, *::after, *::before {
    box-sizing: inherit;
}

.bottom-notifications {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.bottom-notification {
    width: 100%;
    background-color: darkblue;
    color: #fff;
    position: relative;
    max-height: 200px;
    -webkit-transform: translateX(0px);
    -ms-transform: translateX(0px);
    transform: translateX(0px);
    -webkit-transition: -webkit-transform 0.3s ease-in, max-height 0.5s linear 0.3s;
    transition: transform 0.3s ease-in, max-height 0.5s linear 0.3s;
    font-size: 12px;
}

.bottom-notification__content {
    max-width: 800px;
    width: 100%;
    overflow: hidden;
    margin: 0 auto;
    text-align: left;
    height: 100%;
}
    
.bottom-notification__text {
    padding: 15px 77px 15px 15px;
    display: block;
    width: 100%;
}


.bottom-notification p {
    margin: 0;
    display: inline;
}

.bottom-notification a {
    color: #fff;
    font-weight: bold;
    text-decoration: underline;
    display: inline;
    white-space: nowrap;
    width: auto;
    clear: none;
}



.button, .bottom-notification__dismiss, .search-box-container .search, .wideunit__button a {
    border: none;
    border-width: 2px 0;
    border-style: solid;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 700;
    padding: 16px;
    -webkit-transition: background-color 0.1s ease-in, border-color 0.1s ease-in;
    transition: background-color 0.1s ease-in, border-color 0.1s ease-in;
    box-sizing: border-box;
    display: inline-block;
    margin-top: 1em;
    width: 100%;
}

.bottom-notification__dismiss {
    display: block;
    background-color: blue;
    border-radius: 0px;
    height: 100%;
    border: 0;
    position: absolute;
    margin-top: 0;
    width: 77px;
    right: 0;
    top: 0;
    z-index: 101;
    outline: 0;
    font-size: 12px;
}

@media screen and (min-width: 768px) {
    .bottom-notification__content {
        text-align: center;
        display: block;
    }

    .bottom-notification__text {
        display: inline-block;
        width: auto;
        margin-right: 0px;
    }
    
    .bottom-notification a {
        padding-left: 15px;
    }

    .bottom-notification__dismiss {
        position: relative;
        width: 45px;
        height: auto;
        padding: 0.5em;
        top: auto;
        right: auto;
        display: inline-block;
    }
}
<div class="bottom-notifications">
<div class="bottom-notification bottom-notification--any" id="notification-5d93762f1abe41aaa78ab86cb59cba7c">
    <div class="bottom-notification__content">
      <span class="bottom-notification__text"><p>By using this site you accept the use of cookies.&nbsp;<a href="http://www.cookielaw.org/the-cookie-law/" target="_blank">Read more</a></p>
</span>
      <button class="bottom-notification__dismiss" data-notificationid="5d93762f1abe41aaa78ab86cb59cba7c" data-cookiename="bulletinalert-14cd5c89c251a9cd882313850af757a10100d620">OK</button>
    </div>
  </div>
</div>

1 个答案:

答案 0 :(得分:1)

这看起来像是旧版浏览器的错误。

我无法在运行Samsung Internet v4.0(Android v6.0.1)的S7 Edge上复制它:

Screenshot

然而,我能够使用Android 4.4.2上的S4复制它,运行Samsung Internet v1.5 - 我使用了三星的Remote Test Lab

Screenshot

关于如何调试浏览器,有一个关于remote debugging Samsung Internet here的部分,我希望它可能有用。