Incorrect dimensions for elements in Samsung's web browser

We are facing an issue with the sticky cookie notification on a website. While it appears correctly on most browsers, the default Samsung browser named "Internet" is causing the text element to be narrower than intended. This results in an unsightly line break, misaligned dismiss button, and unnecessary extra height for the sticky element.

https://i.sstatic.net/zkzg1.jpg

I am unsure where to begin addressing this problem, especially since it seems to be isolated to Samsung's mobile browsers, and I am unable to use any CSS/DOM inspection tools on them. Any suggestions?

Fiddle: 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>

Answer №1

This issue seems to be a result of compatibility issues with an outdated browser version.

I conducted tests on the S7 Edge using Samsung Internet v4.0 (Android v6.0.1) and did not encounter the same problem:

https://i.sstatic.net/LuDMIl.png

However, when I tested it on an S4 with Android 4.4.2, running Samsung Internet v1.5, I was able to reproduce the issue - I utilized Samsung's Remote Test Lab for this purpose:

https://i.sstatic.net/1yBVHl.png

If you need guidance on debugging the browser, there is a specific section outlining how to do so in remote debugging Samsung Internet here which should provide helpful insights.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Ensure that pressing the ENTER key on a form will only activate a specific submit button, even when there are multiple buttons present

I have a form containing two submit buttons - name="submit_button" and name="search_me_logo". Depending on which button is pressed, the form should perform different actions when it reaches the action location. Currently, when the enter key is pressed, th ...

Adjust SVG Checkbox to eliminate any unnecessary padding

I am attempting to customize the MUI5 checkbox CSS fields, and here is the current status: https://i.stack.imgur.com/BROpS.png These are my CSS classes: MuiCheckbox: { styleOverrides: { root: { ".MuiSvgIcon-root": { backgro ...

The main thread of Android is becoming overwhelmed with tasks while gathering Flow data

My local database function returns the list of users in Flow format, specifically as Flow<List<User>>. On the home screen, only the most recent list of users is displayed. However, there is an issue when launching the app and pre-populating the ...

Beginner: Interested in creating a web application with HTML, CSS, AngularJS, NodeJS, and MySQL?

After extensive searching on the internet, I have yet to come across a definitive answer. I am in the early stages of developing a web application and want to ensure that I am using the correct languages before diving too deep into it. Currently, my plan ...

How can I alter the background color of the entire header in Ionic?

Having some trouble changing the color of my header. I successfully changed the color of the white header, but not the black header where the time is displayed. I know this is beyond Ionic and part of Android, but I have seen other apps that are able to ch ...

What is the best way to align text in the middle of a card using bootstrap?

I crafted a code to display cards using Bootstrap 4. My goal now is to center all the text inside the card, but I'm facing challenges in achieving this. I attempted to apply "text-center" to the entire section. I also tried using "d-flex" and justify ...

Ensure that a block element positioned relative to its container is the exact same size as the absolute-positioned element within

Currently, I am attempting to stack multiple divs along with their content atop each other while ensuring the containing div (#stack) remains in the normal flow of the document by implementing the following technique: CSS: #stack { position:relative; ...

Creating space at the beginning of a webpage

I can't seem to get rid of the white space at the top of my website and I'm not sure what else to try: body { border: 0; padding: 0; margin: 0; } .header { width: 900px; height: 100px; background-color: #5132FF; text-align: cent ...

How can I customize the output directory for Jacoco on Android?

After completing my Android project, the Jacoco coverage report file is saved in the directory: "/app/build/reports/jacoco/~" I am interested in learning how to modify the Jacoco output directory to something like "/build/~". If there are any available o ...

Inline-block divs styled with CSS3 are causing a white gap to appear at the top of

I have been searching for solutions to my problem, but I can't seem to find one that works. My goal is to create two columns that each take up 50% of the screen width. However, I am facing an issue where there is a gap at the top that I cannot seem t ...

Updating the textview in an Android app using Java from a separate class or thread through interface communication

Trying to edit the textview text from the MainActivity class by using a function connected to an interface, which then goes into another class named JobService (class for sending something with threads in it). However, encountering an error in the construc ...

Interactive Hover-Dropdown Effect on a Styled Division

Recently, I encountered an issue with my drop-down menu where it goes behind another div when hovered over. This causes the drop-down menu to not be fully visible. I tried adjusting the z-index thinking it would solve the problem, but unfortunately, it di ...

Dynamic Data Binding in Ionic 2

One challenge I am facing is with creating my own info window for a Google Maps marker. Whenever I click on the marker, a div is displayed but the information inside the div does not get updated. It seems like the event.title remains unchanged from its old ...

Preventing Click Events from Firing During Drag in JavaScript

I have implemented a code for dragging containers left or right, which is functioning properly. Users can also click on the "thumb". However, I am facing an issue where a click event occurs even after dragging. I want to ensure that only either drag or cli ...

Should buttons be wrapped based on the text of the link?

I'm struggling to include buttons in my design but I can't seem to achieve the desired outcome. The image below illustrates what I am attempting to create but have been unsuccessful in replicating: https://i.sstatic.net/CnYLV.png However, the ...

Guide on resetting Android Studio Artic Fox back to its default settings

Is there a way to reset the Artic Fox version of AS back to its original settings? ...

Setting the height of a div based on its own width: A step-by-step guide

Is there a way to dynamically adjust the height of a div based on its width using CSS and Bootstrap? I am looking to maintain an aspect ratio of 75:97 for the height and width of the div. .my-div{ height: auto; border-radius: 20px; padding: 20 ...

Adjusting the size of the iframe on-the-fly

Scenario: Currently, I am tackling a project involving developing a responsive design using the standard HTML/CSS combination. Everything seems to be working smoothly except for one specific situation where an iframe is nested inside a div. The challenge l ...

Utilizing Yeoman/Grunt for Generating CSS from SASS Files in a Specific Subdirectory

Reviewing My Current Folder Structure: https://i.sstatic.net/RuNqd.png All my sass files residing in the styles folder (like newStyles.sass) are getting compiled successfully. However, the sass files within the myUi directory (e.g., nuclearMed.sass) are ...

What is the best way to eliminate the gap between the dropdown-toggle button and dropdown-menu items?

Why does a space appear between the dropdown-toggle button and dropdown-menu? Is there a way to remove this space? The box-shadow currently conceals the gap, but it becomes visible once the box-shadow is eliminated. Here is the code snippet: <!DOCT ...